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

perf: cache the lookup of should_trace_cache #1401

Closed
wants to merge 1 commit into from

Conversation

nedbat
Copy link
Owner

@nedbat nedbat commented Jun 11, 2022

Doesn't seem to improve performance by more than about .5%

pyver proj without cache with cache compare
python3.11 bug1339.py 0.767 s 0.819 s 106.77%
python3.11 bm_sudoku.py 50.346 s 50.142 s 99.60%
python3.11 bm_spectral_norm.py 60.180 s 59.727 s 99.25%

Doesn't seem to improve performance by more than about .5%

| pyver | proj | 0b74900 | source | compare |
|----|----|----|----|----|
| python3.11 | bug1339.py | 0.767 s | 0.819 s | 106.77% |
| python3.11 | bm_sudoku.py | 50.346 s | 50.142 s | 99.60% |
| python3.11 | bm_spectral_norm.py | 60.180 s | 59.727 s | 99.25% |
@nedbat
Copy link
Owner Author

nedbat commented Jun 11, 2022

This is about what I expected, since the dict lookup is only once per function call, and dict lookups are fast.

@nedbat nedbat closed this Aug 6, 2022
@nedbat nedbat deleted the nedbat/one-filename-cache branch October 17, 2022 15:49
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.

1 participant