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

Write version to file to avoid overhead of pkg_resources.get_distribution #105

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

hugovk
Copy link
Owner

@hugovk hugovk commented Oct 7, 2021

Speeds up CLI.

Python 3.9

main

$ time tinytext --version
tinytext 2.6.1.dev18
tinytext --version  0.49s user 0.13s system 96% cpu 0.636 total

PR

$ time tinytext --version
tinytext 2.6.1.dev18
tinytext --version  0.09s user 0.03s system 94% cpu 0.122 total

-> 5.2 times faster

Python 3.10

main

$ time tinytext --version
tinytext 2.6.1.dev18
tinytext --version  0.48s user 0.12s system 97% cpu 0.614 total

PR

$ time tinytext --version
tinytext 2.6.1.dev18
tinytext --version  0.09s user 0.03s system 95% cpu 0.119 total

-> 5.0 times faster

@hugovk hugovk added the changelog: Changed For changes in existing functionality label Oct 7, 2021
@codecov
Copy link

codecov bot commented Oct 7, 2021

Codecov Report

Merging #105 (18a6d3f) into main (aab5714) will increase coverage by 100.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           main      #105        +/-   ##
===========================================
+ Coverage      0   100.00%   +100.00%     
===========================================
  Files         0         2         +2     
  Lines         0        12        +12     
===========================================
+ Hits          0        12        +12     
Flag Coverage Δ
GHA_Ubuntu 100.00% <100.00%> (?)
GHA_macOS 100.00% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/tinytext/__init__.py 100.00% <100.00%> (ø)
tests/test_tinytext.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aab5714...18a6d3f. Read the comment docs.

@hugovk hugovk merged commit 8cb9d25 into main Oct 7, 2021
@hugovk hugovk deleted the hardcoded-constant branch October 7, 2021 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Changed For changes in existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant