Title: Detect number of CPUs with `--num-workers auto` · Issue #21477 · python/mypy · GitHub
Open Graph Title: Detect number of CPUs with `--num-workers auto` · Issue #21477 · python/mypy
X Title: Detect number of CPUs with `--num-workers auto` · Issue #21477 · python/mypy
Description: Feature Mypy 2.0 added an experimental flag: -n, --num-workers NUM_WORKERS Number of separate mypy worker processes (experimental) Thanks for this! Running mypy --num-workers 8 on this 8-core machine for Pillow takes 3s instead of 10s (b...
Open Graph Description: Feature Mypy 2.0 added an experimental flag: -n, --num-workers NUM_WORKERS Number of separate mypy worker processes (experimental) Thanks for this! Running mypy --num-workers 8 on this 8-core machi...
X Description: Feature Mypy 2.0 added an experimental flag: -n, --num-workers NUM_WORKERS Number of separate mypy worker processes (experimental) Thanks for this! Running mypy --num-workers 8 on this 8-core machi...
Opengraph URL: https://github.com/python/mypy/issues/21477
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Detect number of CPUs with `--num-workers auto`","articleBody":"**Feature**\n\n\u003c!-- Enter a clear and concise description of your feature proposal here. -->\n\nMypy 2.0 added an experimental flag:\n\n```\n -n, --num-workers NUM_WORKERS\n Number of separate mypy worker processes (experimental)\n```\n\nThanks for this! Running `mypy --num-workers 8` on this 8-core machine for Pillow takes 3s instead of 10s (both with no cache).\n\nI suggest `--num-workers 0` detects the number of CPUs available.\n\n**Pitch**\n\n\u003c!-- Please explain why this feature should be implemented and how it would be used. Add examples, if applicable. -->\n\nThis means the value doesn't need changing for other machines. We can put `--num-workers 0` in our tox config and it will use the correct number for each machine and also for the CI.\n\nAlternatively, `--num-workers auto`.\n\nOther tools commonly use `0` or `auto` to use the number of available CPUs (or sometimes unlimited). Some default to this.\n\n**Further**\n\nRight now, it looks like `--num-workers 0` disables the parallel machinery, and `--num-workers 1` sets it up with a single worker. It could be more efficient for `1` to run without this overhead.\n\nhttps://github.com/python/mypy/blob/d2b023417be30efb44c6cbe60530c956069ff70d/mypy/build.py#L391\n","author":{"url":"https://github.com/hugovk","@type":"Person","name":"hugovk"},"datePublished":"2026-05-13T11:03:06Z","url":"https://github.com/python/mypy/issues/21477"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:691b536e-0a27-e3fc-75a2-456ec598e841 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA56:1A3D7F:30CB8F9:40871CB:6B002823 |
| html-safe-nonce | 330fd1e1cbf7d8a37f2ac1037de85e006b4b37eff2c6cbc04443de030d670eed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTU2OjFBM0Q3RjozMENCOEY5OjQwODcxQ0I6NkIwMDI4MjMiLCJ2aXNpdG9yX2lkIjoiMTc5ODY3NjE0NDM2NzYwOTg5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4d63ff25738b778b96d991a363462dbe01b809ca83eaaa4afffbcb6991b1357e |
| hovercard-subject-tag | issue:4437290213 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/21477/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f27399edf60266b6b31187c7f95e9f24a8c5cf3e04a6e538daa5e2959d1cc74f/python/mypy/issues/21477 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f27399edf60266b6b31187c7f95e9f24a8c5cf3e04a6e538daa5e2959d1cc74f/python/mypy/issues/21477 |
| og:image:alt | Feature Mypy 2.0 added an experimental flag: -n, --num-workers NUM_WORKERS Number of separate mypy worker processes (experimental) Thanks for this! Running mypy --num-workers 8 on this 8-core machi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hugovk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width