black/src
Richard Si e269f44b25 Lazily import parallelized format modules
`black.reformat_many` depends on a lot of slow-to-import modules. When
formatting simply a single file, the time paid to import those modules
is totally wasted. So I moved `black.reformat_many` and its helpers
to `black.concurrency` which is now *only* imported if there's more
than one file to reformat. This way, running Black over a single file
is snappier

Here are the numbers before and after this patch running `python -m
black --version`:

- interpreted: 411 ms +- 9 ms -> 342 ms +- 7 ms: 1.20x faster
- compiled: 365 ms +- 15 ms -> 304 ms +- 7 ms: 1.20x faster

Co-authored-by: Fabio Zadrozny <fabiofz@gmail.com>
2022-08-26 21:11:00 -04:00
..
black Lazily import parallelized format modules 2022-08-26 21:11:00 -04:00
blackd add preview option support for blackd (#3217) 2022-08-12 20:23:02 -07:00
blib2to3 Use --no-implicit-optional for type checking (#3220) 2022-08-12 19:28:47 -07:00