Details
-
Bug
-
Resolution: Fixed
-
P2
-
8
-
b89
-
Not verified
Description
In order to avoid relink of JSAdapter based instance (nodejar Buffer) method calls, we have migrated all properties and functions to the overrides. The overrides has grown from 8 properties to 40 properties.
Now we don't have missed call sites but very slow creation time. We have an impact on all usage of Buffer.
I have attached a nashorn testcase that shows that construction time of an instance is 10x slower.
1) Run it: java jdk.nashorn.tools.Shell slow-adapter
2) Should take around 9sec to create 100000 instances.
3) Uncomment the properties in overrides.
4) Run it again, should take more than 100secs.
Time is spent in the NativeJSAdapter constructor when adding Spill properties (StandardMethodHandleFunctionality.arrayElementGetter). I have attached a jvisualvm/netbeans profiler snapshot.
More details on perf analysis: https://kenai.com/projects/nodejs/pages/Perf_18_April_2013
Now we don't have missed call sites but very slow creation time. We have an impact on all usage of Buffer.
I have attached a nashorn testcase that shows that construction time of an instance is 10x slower.
1) Run it: java jdk.nashorn.tools.Shell slow-adapter
2) Should take around 9sec to create 100000 instances.
3) Uncomment the properties in overrides.
4) Run it again, should take more than 100secs.
Time is spent in the NativeJSAdapter constructor when adding Spill properties (StandardMethodHandleFunctionality.arrayElementGetter). I have attached a jvisualvm/netbeans profiler snapshot.
More details on perf analysis: https://kenai.com/projects/nodejs/pages/Perf_18_April_2013