Skip to content

Consider reverting optimization in normalization #540

Description

@jaraco

In #533 (comment)_, I got the impression that the optimization may be premature. Now that code bases have stabilized and the performance checks are more precise, let's revisit 3e7f3ac and decide if it's really worth the complication.

Activity

  1. jaraco commented on Jul 14, 2026

    @jaraco
    MemberAuthor

    As a baseline, here are a couple of snapshots of the performance tests without any diff:

    exercises.py:cached distribution: 128 µsec (-2 µsec, -2%)
    exercises.py:discovery: 129 µsec (-1 µsec, -1%)
    exercises.py:entry_points(): 1.47 msec (+40 µsec, 3%)
    exercises.py:entrypoint_regexp_perf: 48.7 µsec (0 nsec, 0%)
    exercises.py:normalize_perf: 93.3 nsec (+2.1 nsec, 2%)
    exercises.py:uncached distribution: 215 µsec (-5 µsec, -2%)
    
    exercises.py:cached distribution: 131 µsec (0 nsec, 0%)
    exercises.py:discovery: 132 µsec (-2 µsec, -1%)
    exercises.py:entry_points(): 1.45 msec (-10 µsec, -1%)
    exercises.py:entrypoint_regexp_perf: 49.5 µsec (+200 nsec, 0%)
    exercises.py:normalize_perf: 87.8 nsec (-1.3 nsec, -1%)
    exercises.py:uncached distribution: 220 µsec (+1 µsec, 0%)
    

    I've seen even higher numbers in the 3-4% range.

    So there's quite a bit of jitter in the tests, meaning we'd probably want to see 6% or better improvement to justify a change.

  2. added 2 commits that reference this issue on Jul 14, 2026
    89e9eb7
    73efee2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions