Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves performance on large commented logical lines #606

Merged
merged 1 commit into from Nov 13, 2018

Conversation

hauntsaninja
Copy link
Collaborator

Fixes #509

> rm -rf ~/Library/Caches/black; time python3 -m black --check profiling/dict_big.py 
All done! ✨ 🍰 ✨
1 file would be left unchanged.

real	0m2.984s
user	0m2.916s
sys	0m0.051s
> sed -i '' '/21233/s/$/  # comment/' profiling/dict_big.py 
> git diff | cat
diff --git a/profiling/dict_big.py b/profiling/dict_big.py
index f330ac5..27a862d 100644
--- a/profiling/dict_big.py
+++ b/profiling/dict_big.py
@@ -7996,6 +7996,6 @@ config = some.Structure(
         "21229": "AB890X",
         "21230": "AB890X",
         "21231": "AB890X",
-        "21233": "AB890X",
+        "21233": "AB890X",  # comment
     }
 )
> rm -rf ~/Library/Caches/black; time python3 -m black --check profiling/dict_big.py
All done! ✨ 🍰 ✨
1 file would be left unchanged.

real	1m17.364s
user	1m17.007s
sys	0m0.144s
> git checkout comment-perf-fix
M	profiling/dict_big.py
Switched to branch 'comment-perf-fix'
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
> rm -rf ~/Library/Caches/black; time python3 -m black --check profiling/dict_big.py
All done! ✨ 🍰 ✨
1 file would be left unchanged.

real	0m3.030s
user	0m2.958s
sys	0m0.053s

@coveralls
Copy link

Pull Request Test Coverage Report for Build 798

  • 17 of 18 (94.44%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 96.094%

Changes Missing Coverage Covered Lines Changed/Added Lines %
black.py 17 18 94.44%
Totals Coverage Status
Change from base Build 797: -0.01%
Covered Lines: 2903
Relevant Lines: 3021

πŸ’› - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 798

  • 17 of 18 (94.44%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 96.094%

Changes Missing Coverage Covered Lines Changed/Added Lines %
black.py 17 18 94.44%
Totals Coverage Status
Change from base Build 797: -0.01%
Covered Lines: 2903
Relevant Lines: 3021

πŸ’› - Coveralls

@JelleZijlstra JelleZijlstra merged commit e4e59f8 into psf:master Nov 13, 2018
jleclanche pushed a commit to jleclanche/tan that referenced this pull request Nov 14, 2018
ambv added a commit that referenced this pull request Mar 14, 2019
Thanks for the original patch to solve #509, @hauntsaninja.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad performance on huge dictionary
3 participants