Reflection vs MethodHandle performance in Oracle JDK 7u7

Ashwin Jayaprakash ashwin.jayaprakash at gmail.com
Mon Oct 15 11:56:18 PDT 2012


Remi, you were right. Disabling tiered compilation sped things up a bit.
But, everything except MethodHandles is slower in JDK 8 than in JDK 7u7.
Especially static and virtual calls (!!)

*JDK 7u7* vs *JDK 8-ea-bin-b59-windows-x64-04_oct_2012* on Win 7, 64bit, 1
cpu x 2 core x 4 HT, i7 920 laptop:

*JDK 8-ea-b59:*
 0% Scenario{vm=java, trial=0, benchmark=Reflect, tune=-server -Xmx96M
-Xmx96M, tier=-XX:+TieredCompilation} 19.35 ns; ?=0.14 ns @ 3 trials
10% Scenario{vm=java, trial=0, benchmark=Handle, tune=-server -Xmx96M
-Xmx96M, tier=-XX:+TieredCompilation} 15.93 ns; ?=0.07 ns @ 3 trials
20% Scenario{vm=java, trial=0, benchmark=Direct, tune=-server -Xmx96M
-Xmx96M, tier=-XX:+TieredCompilation} 7.26 ns; ?=0.03 ns @ 3 trials
30% Scenario{vm=java, trial=0, benchmark=Iface, tune=-server -Xmx96M
-Xmx96M, tier=-XX:+TieredCompilation} 7.24 ns; ?=0.00 ns @ 3 trials
40% Scenario{vm=java, trial=0, benchmark=Static, tune=-server -Xmx96M
-Xmx96M, tier=-XX:+TieredCompilation} 7.18 ns; ?=0.02 ns @ 3 trials
50% Scenario{vm=java, trial=0, benchmark=Reflect, tune=-server -Xmx96M
-Xmx96M, tier=-XX:-TieredCompilation} 18.51 ns; ?=0.10 ns @ 3 trials
60% Scenario{vm=java, trial=0, benchmark=Handle, tune=-server -Xmx96M
-Xmx96M, tier=-XX:-TieredCompilation} 15.75 ns; ?=0.06 ns @ 3 trials
70% Scenario{vm=java, trial=0, benchmark=Direct, tune=-server -Xmx96M
-Xmx96M, tier=-XX:-TieredCompilation} 7.23 ns; ?=0.02 ns @ 3 trials
80% Scenario{vm=java, trial=0, benchmark=Iface, tune=-server -Xmx96M
-Xmx96M, tier=-XX:-TieredCompilation} 7.12 ns; ?=0.03 ns @ 3 trials
90% Scenario{vm=java, trial=0, benchmark=Static, tune=-server -Xmx96M
-Xmx96M, tier=-XX:-TieredCompilation} 7.20 ns; ?=0.06 ns @ 3 trials

benchmark                   tier    ns linear runtime
  Reflect -XX:+TieredCompilation 19.35 ==============================
  Reflect -XX:-TieredCompilation 18.51 ============================
   Handle -XX:+TieredCompilation 15.93 ========================
   Handle -XX:-TieredCompilation 15.75 ========================
   Direct -XX:+TieredCompilation  7.26 ===========
   Direct -XX:-TieredCompilation  7.23 ===========
    Iface -XX:+TieredCompilation  7.24 ===========
    Iface -XX:-TieredCompilation  7.12 ===========
   Static -XX:+TieredCompilation  7.18 ===========
   Static -XX:-TieredCompilation  7.20 ===========

vm: java
trial: 0
tune: -server -Xmx96M -Xmx96M


*JDK 7u7:*
 0% Scenario{vm=java, trial=0, benchmark=Reflect, tune=-server -Xmx96M
-Xmx96M, tier=-XX:+TieredCompilation} 16.21 ns; ?=0.16 ns @ 10 trials
10% Scenario{vm=java, trial=0, benchmark=Handle, tune=-server -Xmx96M
-Xmx96M, tier=-XX:+TieredCompilation} 20.40 ns; ?=0.17 ns @ 3 trials
20% Scenario{vm=java, trial=0, benchmark=Direct, tune=-server -Xmx96M
-Xmx96M, tier=-XX:+TieredCompilation} 4.80 ns; ?=0.04 ns @ 3 trials
30% Scenario{vm=java, trial=0, benchmark=Iface, tune=-server -Xmx96M
-Xmx96M, tier=-XX:+TieredCompilation} 4.92 ns; ?=0.03 ns @ 3 trials
40% Scenario{vm=java, trial=0, benchmark=Static, tune=-server -Xmx96M
-Xmx96M, tier=-XX:+TieredCompilation} 4.85 ns; ?=0.02 ns @ 3 trials
50% Scenario{vm=java, trial=0, benchmark=Reflect, tune=-server -Xmx96M
-Xmx96M, tier=-XX:-TieredCompilation} 17.32 ns; ?=1.33 ns @ 10 trials
60% Scenario{vm=java, trial=0, benchmark=Handle, tune=-server -Xmx96M
-Xmx96M, tier=-XX:-TieredCompilation} 20.44 ns; ?=0.54 ns @ 10 trials
70% Scenario{vm=java, trial=0, benchmark=Direct, tune=-server -Xmx96M
-Xmx96M, tier=-XX:-TieredCompilation} 4.86 ns; ?=0.10 ns @ 10 trials
80% Scenario{vm=java, trial=0, benchmark=Iface, tune=-server -Xmx96M
-Xmx96M, tier=-XX:-TieredCompilation} 4.84 ns; ?=0.01 ns @ 3 trials
90% Scenario{vm=java, trial=0, benchmark=Static, tune=-server -Xmx96M
-Xmx96M, tier=-XX:-TieredCompilation} 4.81 ns; ?=0.03 ns @ 3 trials

benchmark                   tier    ns linear runtime
  Reflect -XX:+TieredCompilation 16.21 =======================
  Reflect -XX:-TieredCompilation 17.32 =========================
   Handle -XX:+TieredCompilation 20.40 =============================
   Handle -XX:-TieredCompilation 20.44 ==============================
   Direct -XX:+TieredCompilation  4.80 =======
   Direct -XX:-TieredCompilation  4.86 =======
    Iface -XX:+TieredCompilation  4.92 =======
    Iface -XX:-TieredCompilation  4.84 =======
   Static -XX:+TieredCompilation  4.85 =======
   Static -XX:-TieredCompilation  4.81 =======

vm: java
trial: 0
tune: -server -Xmx96M -Xmx96M


Regards,
Ashwin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20121015/6e83cb53/attachment.html 


More information about the mlvm-dev mailing list