-
Notifications
You must be signed in to change notification settings - Fork 356
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
Optimize SbTag::eq
#2218
Optimize SbTag::eq
#2218
Conversation
The code before generated really bad code with a branch. This nudges LLVM towards being smarter and simply comparing the integers.
This change was suggested by @saethlin somewhere, but I don't recall where. |
That's an interesting clippy lint, first time I've seen it |
I suggested this here: rust-lang/rust#49892 (comment) How does this compare to #2214 ? Obviously we could have both of these (and this change plays nicely with #1935 because it also benefits the cache lookup code path) but it would be good to have benchmarks for both. Generally I'm okay with the sort of change in this PR though I'd rather solve this codegen problem by improving Also as a sidenote, all this optimization in this and #2214 is very much in the weeds unless you rebase those onto #1935 which I promise I will make progress on soon. |
Also since we're dealing with such small optimizations I wonder if this intersects with #2132 |
For benches, see my comments in #2214. |
Thanks, this makes sense! |
📌 Commit 93db9a6 has been approved by |
☀️ Test successful - checks-actions |
The code before generated really bad code with a branch.
This nudges LLVM towards being smarter and simply comparing
the integers.
See #2214 (comment)