FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Defer `fractions.Fraction` import to save 5ms by hugovk · Pull Request #201 · python-humanize/humanize · GitHub

Defer fractions.Fraction import to save 5ms - #201

Merged
hugovk merged 1 commit into
python-humanize:mainfrom
hugovk:defer-fractions
Sep 9, 2024
Merged

Defer fractions.Fraction import to save 5ms#201
hugovk merged 1 commit into
python-humanize:mainfrom
hugovk:defer-fractions

Conversation

hugovk commented Sep 9, 2024

Copy link
Copy Markdown
Member

main

PR

hyperfine

hyperfine --warmup 32 \
--prepare "git checkout defer-fractions" 'python3 -c "import humanize # PR"' \
--prepare "git checkout main"            'python3 -c "import humanize # main"'
Benchmark 1: python3 -c "import humanize # PR"
  Time (mean ± σ):      46.1 ms ±  10.7 ms    [User: 34.4 ms, System: 8.5 ms]
  Range (min … max):    39.6 ms …  95.3 ms    55 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 ± σ):      52.7 ms ±  16.7 ms    [User: 38.8 ms, System: 9.1 ms]
  Range (min … max):    41.7 ms … 118.4 ms    46 runs

Summary
  python3 -c "import humanize # PR" ran
    1.14 ± 0.45 times faster than python3 -c "import humanize # main"

hugovk added the changelog: Changed For changes in existing functionality label Sep 9, 2024
hugovk enabled auto-merge September 9, 2024 18:32
hugovk merged commit 94fc781 into python-humanize:main Sep 9, 2024
hugovk deleted the defer-fractions branch September 9, 2024 18:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL