-
Notifications
You must be signed in to change notification settings - Fork 188
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
Inline AddNode specialization that are not yet inlined into InlinedAddNode #2518
Conversation
…dNode Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
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.
This looks good, thanks, I'll also do it for InlinedSubNode for consistency.
In general Inlined*Node
do inline the logic if it's trivial (hence it was done for double
), here it's not fully trivial but still reasonably simple and short (two 1-line specializations). I'll probably cross-link them via JavaDoc to keep them in sync (e.g., the addWithOverflow(long, long) could probably do something better by doing a fast-path overflow check in the future).
… FixnumOrBignumNode`
@Specialization(assumptions = "assumptions") | ||
protected Object intAdd(int a, int b) { | ||
return getAddNode().executeAdd(a, b); | ||
@Specialization(rewriteOn = ArithmeticException.class) |
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.
There is one bug here that each of these specializations should check the Assumptions with assumptions = "assumptions"
.
4d14308
to
fd203cf
Compare
Hm, so, not sure whether this is a huge win overall. Results are generally indicating a reduction of interpreter run time, but it's small I'd think. |
Maybe the |
…o InlinedAddNode (#2518) PullRequest: truffleruby/3022
This change improves interpreter speed on microbenchmarks like Mandelbrot, Sieve, Storage, reducing run time by 7%.
More interesting benchmarks, don't really show any change.
Performance report here: https://rebench.stefan-marr.de/compare/TruffleRuby/069b9e68efef1a09f6fa2a2c722059af43e300ae/60c3282176185aa99c0f1ab8c727c6e6822c8513#ruby-startup-TruffleRuby-native-interp
The drawback is that this duplicates logic from the
AddNode
. Though, the logic duplicated seems trivial, and thedouble
logic was already duplicated to start with.