-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b29
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085696 | emb-9 | Attila Szegedi | P4 | Resolved | Fixed | team |
JDK-8064201 | 8u45 | Attila Szegedi | P4 | Resolved | Fixed | b01 |
JDK-8056161 | 8u40 | Attila Szegedi | P4 | Resolved | Fixed | b04 |
JDK-8070438 | emb-8u47 | Attila Szegedi | P4 | Resolved | Fixed | team |
$ hg diff
diff -r ad7a46083364 src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java Mon Aug 25 20:26:53 2014 +0530
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java Mon Aug 25 22:44:54 2014 +0400
@@ -166,7 +166,7 @@
// do these in parallel, this significantly reduces class installation overhead
// however - it still means that every thread needs a separate doPrivileged
final Global global = currentGlobal.get();
- classes.parallelStream().forEach(
+ classes.stream().forEach(
new Consumer<Class<?>>() {
@Override
public void accept(final Class<?> clazz) {
On the current jdk9/dev and this simple benchmark:
$ for I in `seq 1 5`; do ~/trunks/jdk9-dev/build/linux-x86_64-normal-server-release/images/j2sdk-image/bin/java -jar ~/trunks/jdk9-dev/build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/ext/nashorn.jar -Dnashorn.typeInfo.disabled=false --class-cache-size=0 --persistent-code-cache=false -scripting --log=time test/script/basic/compile-octane.js -- --iterations 1 2>&1 | grep "Class Installation"; done
...yields a nice improvement.
Before (parallel):
[time] 'Class Installation' 4616 ms
[time] 'Class Installation' 4563 ms
[time] 'Class Installation' 4712 ms
[time] 'Class Installation' 4637 ms
[time] 'Class Installation' 4668 ms
After (sequential):
[time] 'Class Installation' 2831 ms
[time] 'Class Installation' 2755 ms
[time] 'Class Installation' 2885 ms
[time] 'Class Installation' 2816 ms
[time] 'Class Installation' 2943 ms
One might consider a threshold for going to parallel version, but that threshold should be figured out experimentally.
- backported by
-
JDK-8056161 Questionable use of parallelStream() in jdk.nashorn.internal.runtime.Context$ContextCodeInstaller.initialize()
- Resolved
-
JDK-8064201 Questionable use of parallelStream() in jdk.nashorn.internal.runtime.Context$ContextCodeInstaller.initialize()
- Resolved
-
JDK-8070438 Questionable use of parallelStream() in jdk.nashorn.internal.runtime.Context$ContextCodeInstaller.initialize()
- Resolved
-
JDK-8085696 Questionable use of parallelStream() in jdk.nashorn.internal.runtime.Context$ContextCodeInstaller.initialize()
- Resolved
- relates to
-
JDK-8055909 Reflective set of SOURCE/CONSTANTS is hot in jdk.nashorn.internal.runtime.Context$ContextCodeInstaller
- Closed
-
JDK-8053904 JVM Warmup: Investigate class installation overhead
- Closed