]> git.madduck.net Git - etc/vim.git/commit

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Lazily import parallelized format modules
authorRichard Si <63936253+ichard26@users.noreply.github.com>
Thu, 4 Aug 2022 00:18:33 +0000 (20:18 -0400)
committerRichard Si <63936253+ichard26@users.noreply.github.com>
Sat, 27 Aug 2022 01:11:00 +0000 (21:11 -0400)
commite269f44b25737360e0dc65379f889dfa931dc68a
treea406490a1de51b088e4ce18303c6eeb0b07f8254
parentc47b91f513052cd39b818ea7c19716423c85c04e
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>
CHANGES.md
docs/contributing/reference/reference_functions.rst
src/black/__init__.py
src/black/concurrency.py
tests/test_black.py