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

Some atomic operations could be made faster by not calling into C #13403

Open
OlivierNicole opened this issue Aug 27, 2024 · 2 comments
Open

Comments

@OlivierNicole
Copy link
Contributor

Some atomic operations are compiled to C calls when they could be compiled to one or two instructions, which would be both shorter and faster than a C call. This is the case of Atomic.fetch_and_add, Atomic.incr , and Atomic.decr, but also, as pointed out by @polytypic in a discussion, Atomic.compare_and_set, Atomic.exchange and Atomic.set, when the operand is integer-like.

@kayceesrk
Copy link
Contributor

You or @polytypic should say something about this on #13397.

@kayceesrk
Copy link
Contributor

Would be nice to see some (not micro) benchmarks. Are there perhaps some queue implementations that can benefit from such inlining where we can see marked increase in throughput?

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

No branches or pull requests

2 participants