Skip to content

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Sep 9, 2024

Like hugovk/tinytext#195.

With Python 3.13.0rc2:

python -X importtime -c "import humanize" 2> import.log && tuna import.log

main

image

PR

image

hyperfine

hyperfine --warmup 32 \
--prepare "git checkout rm-importlib.metadata" 'python3 -c "import humanize # PR"' \
--prepare "git checkout main"                  'python3 -c "import humanize # main"'
Benchmark 1: python3 -c "import humanize # PR"
  Time (mean ± σ):      23.5 ms ±   3.5 ms    [User: 18.0 ms, System: 4.3 ms]
  Range (min … max):    21.8 ms …  43.4 ms    75 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs.

Benchmark 2: python3 -c "import humanize # main"
  Time (mean ± σ):      43.4 ms ±   2.3 ms    [User: 34.5 ms, System: 7.6 ms]
  Range (min … max):    41.8 ms …  52.9 ms    52 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs.

Summary
  python3 -c "import humanize # PR" ran
    1.85 ± 0.29 times faster than python3 -c "import humanize # main"

Also move mypy from pre-commit to tox, so it runs when the version file has been generated.

@hugovk hugovk added the changelog: Changed For changes in existing functionality label Sep 9, 2024
@hugovk hugovk merged commit 74dcc60 into python-humanize:main Sep 9, 2024
29 checks passed
@hugovk hugovk deleted the rm-importlib.metadata branch September 9, 2024 18:27
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