-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Truffle] Use a class profile for truffle objects and a primitive pro…
…file otherwise.
- 9.4.12.0
- 9.4.11.0
- 9.4.10.0
- 9.4.9.0
- 9.4.8.0
- 9.4.7.0
- 9.4.6.0
- 9.4.5.0
- 9.4.4.0
- 9.4.3.0
- 9.4.2.0
- 9.4.1.0
- 9.4.0.0
- 9.3.15.0
- 9.3.14.0
- 9.3.13.0
- 9.3.12.0
- 9.3.11.0
- 9.3.10.0
- 9.3.9.0
- 9.3.8.0
- 9.3.7.0
- 9.3.6.0
- 9.3.5.0
- 9.3.4.0
- 9.3.3.0
- 9.3.2.0
- 9.3.1.0
- 9.3.0.0
- 9.2.21.0
- 9.2.20.1
- 9.2.20.0
- 9.2.19.0
- 9.2.18.0
- 9.2.17.0
- 9.2.16.0
- 9.2.15.0
- 9.2.14.0
- 9.2.13.0
- 9.2.12.0
- 9.2.11.1
- 9.2.11.0
- 9.2.10.0
- 9.2.9.0
- 9.2.8.0
- 9.2.7.0
- 9.2.6.0
- 9.2.5.0
- 9.2.4.1
- 9.2.4.0
- 9.2.3.0
- 9.2.2.0
- 9.2.1.0
- 9.2.0.0
- 9.1.17.0
- 9.1.16.0
- 9.1.15.0
- 9.1.14.0
- 9.1.13.0
- 9.1.12.0
- 9.1.11.0
- 9.1.10.0
- 9.1.9.0
- 9.1.8.0
- 9.1.7.0
- 9.1.6.0
1 parent
5634c88
commit 07128c4
Showing
1 changed file
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
07128c4
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.
@thedarkone this solves the problem of profiles hanging on to arbitrary objects. We now profile primitives for their value, and objects only for their Java class.
07128c4
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.
Wow, you haven't forgotten about that one!
This is a right move, I still think remembering obj identity buys us really little in Ruby (e.g. it doesn't mean the shape of the obj or the class of the ruby obj hasn't changed, etc.)
I'm wondering if the ruby-level class profile is even worth it, since Truffle does its own
.getClass()
profiling of call target args (and does it in a genius way, by profiling at the call site where the type information is almost always "freely" available in the Graal IR).07128c4
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.
Yes, I don't understand here why the Truffle class profiling doesn't make the class profile here redundant. But if you remove either of the two profiles above benchmarks will drop and compiler tests will fail. We tried a lot of different ways of profiling, and this did the best on average. I don't really know why!
07128c4
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.
Well, if I remember correctly, it does get disabled if the call target is called with variable arg lengths (ie it gives up right away and doesn't attempt to profile a max prefix) or if the call target is ever used as a target of an indirect call.
Do you have an exemplary (smallish 😄) bench?
07128c4
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.
I don't have one benchmark in particular - part of the problem was it varied for benchmarks and we needed to look at the aggregate.
But look at the PSD compose benchmarks (https://github.com/jruby/all-ruby-benchmarks/tree/master/psd.rb) and the acid benchmark (https://github.com/jruby/all-ruby-benchmarks/blob/master/synthetic/acid.rb). They varied a lot for different kinds of profiles.