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

Attempt to speed up ready #5

Closed
wants to merge 5 commits into from
Closed

Attempt to speed up ready #5

wants to merge 5 commits into from

Conversation

bdraco
Copy link
Owner

@bdraco bdraco commented Aug 10, 2024

For testing, IGNORE

This probably won't do much, but since much of the time is spent in TimerHandle.__lt__ maybe something can be done here

% python3 bench/call_at.py

before: call_at_benchmark 252.9052056250075
after: call_at_benchmark 228.09943808300886

% python3 bench/timer_handle_heap.py
wrap when, TimerHandle in tuple 34.082984749999014
bare TimerHandle 49.678519583001616

@bdraco
Copy link
Owner Author

bdraco commented Aug 10, 2024

This does seem to make a difference at least in cProfile since it avoids all the __lt__ calls

@bdraco
Copy link
Owner Author

bdraco commented Aug 10, 2024

need a way to profile this

@bdraco
Copy link
Owner Author

bdraco commented Aug 10, 2024

This seems counter intuitive that it would be faster but I guess the tuple comparison on the when value can all be done in native code

@bdraco
Copy link
Owner Author

bdraco commented Aug 10, 2024

submitted as python#122882

@bdraco bdraco closed this Aug 10, 2024
@bdraco bdraco deleted the ready_test branch August 10, 2024 14:29
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