René's URL Explorer Experiment


Title: perf(pii): batch spaCy NER passes in redact_batch by TheodoreSpeaks · Pull Request #8772 · simstudioai/sim · GitHub

Open Graph Title: perf(pii): batch spaCy NER passes in redact_batch by TheodoreSpeaks · Pull Request #8772 · simstudioai/sim

X Title: perf(pii): batch spaCy NER passes in redact_batch by TheodoreSpeaks · Pull Request #8772 · simstudioai/sim

Description: Summary Presidio's BatchAnalyzerEngine.analyze_iterator defaults nlp.pipe to batch_size=1, so every /redact_batch request that runs spaCy NER does one forward pass per text. Prod chunks sit at the 2000-text cap almost always (median and p90 = 2000 texts on the full-NLP path), so each request was paying 2000 separate passes. This passes batch_size=256 through. Context: PII redaction latency in prod has been elevated since an org enabled 9-entity full-NLP redaction; uncontended 2000-text requests take ~12s (p10) and p50 is 26-36s even after scaling the fleet to 10 tasks. This halves the CPU cost per request without changing detections. Type of Change Bug fix New feature Breaking change Documentation Other: performance Testing Built docker/pii.Dockerfile locally and ran _analyze_many on 2000 synthetic prod-shaped texts (1 CPU, best of 2), asserting detected spans are identical to batch_size=1: Texts Entities bs=1 bs=64 bs=256 ~70 B 9-entity 4.21s 1.82s 1.84s ~70 B all 5.08s 4.11s 2.63s ~141 B 9-entity 6.14s 3.21s 3.03s ~141 B all 6.34s 3.74s 3.54s Detections were identical at every batch size. Memory stays bounded since requests are already capped at 256 KB by pii-batching.ts. Regex-only requests (blank-artifacts fast path) are unaffected. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA) 🤖 Generated with Claude Code https://claude.ai/code/session_018cHfdA1zkn7otFDmHHqtRd

Open Graph Description: Summary Presidio's BatchAnalyzerEngine.analyze_iterator defaults nlp.pipe to batch_size=1, so every /redact_batch request that runs spaCy NER does one forward pass per text. Prod chunks sit at ...

X Description: Summary Presidio's BatchAnalyzerEngine.analyze_iterator defaults nlp.pipe to batch_size=1, so every /redact_batch request that runs spaCy NER does one forward pass per text. Prod chunks sit...

Opengraph URL: https://github.com/simstudioai/sim/pull/8772

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:a886f106-9f19-f795-e667-f28465f04593
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDBD4:27DCD7:DFC8A1:1318E95:6AFB5A9B
html-safe-nonce9d83325fbece1056ad31e2c46e3c72819666fc56dcb95ef3c8d806f60df223d2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQkQ0OjI3RENENzpERkM4QTE6MTMxOEU5NTo2QUZCNUE5QiIsInZpc2l0b3JfaWQiOiI2NTY3NzU4OTQ0NTI3OTMyMDU5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd9801d07e8d1941f87d1361cc1379aefe9790f4d5dce44d4fa31f9a25728365f
hovercard-subject-tagpull_request:4780369509
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/8772/files
twitter:imagehttps://avatars.githubusercontent.com/u/19564703?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/19564703?s=400&v=4
og:image:altSummary Presidio's BatchAnalyzerEngine.analyze_iterator defaults nlp.pipe to batch_size=1, so every /redact_batch request that runs spaCy NER does one forward pass per text. Prod chunks sit at ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release59ef97164c52cf59bd10558ddec9c4f482763988
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/8772/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8772%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8772%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/8772/files
Reloadhttps://github.com/simstudioai/sim/pull/8772/files
Reloadhttps://github.com/simstudioai/sim/pull/8772/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
TheodoreSpeakshttps://github.com/TheodoreSpeaks
staginghttps://github.com/simstudioai/sim/tree/staging
perf/pii-spacy-batch-sizehttps://github.com/simstudioai/sim/tree/perf/pii-spacy-batch-size
Conversation 2 https://github.com/simstudioai/sim/pull/8772
Commits 1 https://github.com/simstudioai/sim/pull/8772/commits
Checks 46 https://github.com/simstudioai/sim/pull/8772/checks
Files changed https://github.com/simstudioai/sim/pull/8772/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8772/files
perf(pii): batch spaCy NER passes in redact_batch https://github.com/simstudioai/sim/pull/8772/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/8772/files
24c9ce2 perf(pii): batch spaCy NER passes in redact_batch TheodoreSpeaks Oct 8, 2026 https://github.com/simstudioai/sim/pull/8772/commits/24c9ce2ed8f7ad2571a0d0d18d3dde8e8d682f49
Clear filters https://github.com/simstudioai/sim/pull/8772/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8772/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8772/files
apps/pii/server.pyhttps://github.com/simstudioai/sim/pull/8772/files#diff-4447adf1c9c684d32a5fd31a17e05677749ef10d0ca6bce34ac9b6263e781a40
View file https://github.com/simstudioai/sim/blob/24c9ce2ed8f7ad2571a0d0d18d3dde8e8d682f49/apps/pii/server.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8772/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8772/files#diff-4447adf1c9c684d32a5fd31a17e05677749ef10d0ca6bce34ac9b6263e781a40
https://github.com/simstudioai/sim/pull/8772/files#diff-4447adf1c9c684d32a5fd31a17e05677749ef10d0ca6bce34ac9b6263e781a40
https://github.com/simstudioai/sim/pull/8772/files#diff-4447adf1c9c684d32a5fd31a17e05677749ef10d0ca6bce34ac9b6263e781a40
Please reload this pagehttps://github.com/simstudioai/sim/pull/8772/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.