-
Notifications
You must be signed in to change notification settings - Fork 25
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
[CLOSED] Build performance test comparing reflection and MethodHandles #285
Comments
Comment by aionick (on Thursday Nov 15, 2018 at 23:41 GMT) I have some benchmarks sitting on my
If anything, it does seem that the lookup phase of |
Comment by jeff-aion (on Friday Nov 16, 2018 at 14:11 GMT) It will definitely be good to get a test we can check in so we can go back to this on different JDK versions to see if anything changes or tweak it to check other cases. The order of the differences is surprising, and definitely needs to be verified/explained, but the general trend sounds about in line with what I suspected: based on the vague Still, we will need to check this against other binding behaviour and the different invoke variants to make sure we have a clear picture. |
Comment by jeff-aion (on Friday Nov 16, 2018 at 14:13 GMT) There is also early discussion around |
Comment by aionick (on Tuesday Nov 20, 2018 at 16:43 GMT) The main findings are as follows:
Why the large difference in resolution times? Typically, resolution using reflection is about 36-50x faster than Consider the case of resolving a field. For reflection, it consults the
Benchmarks were done on a target class that had 4 static fields, 4 instance fields, 3 constructors, 4 instance methods and 4 static methods, all pretty mocked up and meaningless. |
Issue created by jeff-aion (on Wednesday Oct 17, 2018 at 21:43 GMT)
In the cases where we don't hit the
SoftCache
, we spend a lot of time looking up reflected elements from the DApp. Even in the cases where we do hit it, we still see reflection-related operations in the profile.There are many claims that
MethodHandle
-based solutions perform better than using reflection (due to a change to when some checks are made, extra inlining opportunity, etc). We need to study this, in isolation, to see if/when to replace our reflection-based solutions withMethodHandle
s.We have 3 points we need to research with this:
Constructor
lookup (for instantiating theIHelper
).Method
lookup (for invokingavm_main
and also in theABIDecoder
).Field
lookup (for persistence-related cases).We need to study each of these questions in a few different ways:
We should be able to test access to each example using the different mechanisms. Cases we need to test:
The text was updated successfully, but these errors were encountered: