-
Notifications
You must be signed in to change notification settings - Fork 340
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
Cleanup backports since we are now Python 3.x+ only #1634
Cleanup backports since we are now Python 3.x+ only #1634
Conversation
Can we really replace our lrucache with the built-in one? The one we have has a comment that says that it's modified to make it more performant. |
As far as I know, lru_cache has had a C implementation since at least python 3.7. I've done a few tests of my own, and functools.lru_cache seems to be at least 3x faster than rez.backport.lru_cache.lru_cache with python 3.11. |
Do you think this is a good place to also tackle enum ? |
Can you share the code you used to run your benchmark? We can also run rez's own benchmark (because yes we have benchmarks).
|
@lru_cache(maxsize=1000)
def fib(n):
return 1 if n in (0, 1) else fib(n - 1) + fib(n - 2) with python -m timeit -s 'from fib import fib' 'fib(495)'
500000 loops, best of 5: 860 nsec per loop with python -m timeit -s 'from fib import fib' 'fib(495)'
5000000 loops, best of 5: 53.9 nsec per loop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups, I wanted to mark it as "request changes". @BryceGattis can you rebase/merge also to resolve the conflict?
Signed-off-by: Bryce Gattis <brycegattis@yahoo.com>
Signed-off-by: Bryce Gattis <brycegattis@yahoo.com>
Signed-off-by: Bryce Gattis <brycegattis@yahoo.com>
Signed-off-by: Bryce Gattis <brycegattis@yahoo.com>
9eb9519
to
99c9ff3
Compare
Signed-off-by: Bryce Gattis <brycegattis@yahoo.com>
…g.py so this PR doesn't affect the vendor folder Signed-off-by: Bryce Gattis <brycegattis@yahoo.com>
Restored |
@BryceGattis you can remove |
Signed-off-by: Bryce Gattis <brycegattis@yahoo.com>
@JeanChristopheMorinPerso Notes addressed 👍 |
8d56142
into
AcademySoftwareFoundation:main
Signed-off-by: Bryce Gattis <brycegattis@yahoo.com>
No description provided.