On Apr 28, 2011, at 12:33 PM, Christian Thalinger wrote:
> On Apr 28, 2011, at 12:16 PM, Christian Thalinger wrote:
>> On Apr 27, 2011, at 5:54 AM, Charles Oliver Nutter wrote:
>>> I prepared this for someone else, but I thought folks here might be
>>> interested in it too.
>>> 
>>> This gist contains hotspot x86 (32-bit) assembly output for JRuby's
>>> dynopt mode and invokedynamic (on a couple-week-old OS X OpenJDK
>>> build). I haven't spent a lot of time investigating.
>> 
>> I took a look at it.  I used 64-bit x86 since the code is a bit smaller than 
>> with 32-bit.
>> 
>> The code is almost identical but three things popped into my eye (the output 
>> is from PrintOptoAssembly):
>> 
>> 1. The obvious one:  the method handle call site guard:
>> 
>> 1a4   B32: #    B160 B33 <- B31 B149 B123  Freq: 0.499969
>> 1a4     movq    R10, byte[int:>=0]<ciObject ident=770 PERM address=0xe99088> 
>> *  # ptr
>> 1ae     movq    R10, [R10 + #1576 (32-bit)]     # ptr
>> 1b5     movq    R11, [R10 + #32 (8-bit)]        # ptr
>> 1b9     movq    R8, java/lang/invoke/AdapterMethodHandle:exact *        # ptr
>> 1c3     cmpq    R11, R8 # ptr
>> 1c6     jne,u  B160  P=0.000000 C=-1.000000
> 
> I did an experiment and hacked a version of HotSpot that does not emit the 
> call site guard.  Since the fib benchmark is monomorphic this works and shows 
> that we just need to get rid of the guard to get on a par with dynopt 
> performance.  The numbers are 32-bit x86.

I have now a patch that makes the command line switch tweaking superfluous and 
the default performance looks pretty good (see below, 32-bit x86).

Charlie, what benchmark could I use for more real world application numbers?  
bench_string_ops.rb sounds and looks promising.  With bench_string_ops.rb I see 
that dynopt performance isn't always better than "normal" (whatever normal is). 
 I guess that is expected?

-- Christian

$ bin/jruby.sh --server -Xcompile.dynopt=false bench/bench_fib_recursive.rb 10 
35
  1.090000   0.000000   1.090000 (  1.059000)
  1.012000   0.000000   1.012000 (  1.012000)
  0.977000   0.000000   0.977000 (  0.977000)
  0.979000   0.000000   0.979000 (  0.979000)
  0.979000   0.000000   0.979000 (  0.979000)
  0.979000   0.000000   0.979000 (  0.979000)
  0.979000   0.000000   0.979000 (  0.979000)
  0.979000   0.000000   0.979000 (  0.979000)
  0.978000   0.000000   0.978000 (  0.978000)
  0.987000   0.000000   0.987000 (  0.987000)

$ bin/jruby.sh --server -Xcompile.dynopt=true bench/bench_fib_recursive.rb 10 35
  1.038000   0.000000   1.038000 (  1.005000)
  0.763000   0.000000   0.763000 (  0.763000)
  0.763000   0.000000   0.763000 (  0.763000)
  0.763000   0.000000   0.763000 (  0.763000)
  0.763000   0.000000   0.763000 (  0.763000)
  0.765000   0.000000   0.765000 (  0.765000)
  0.764000   0.000000   0.764000 (  0.764000)
  0.763000   0.000000   0.763000 (  0.763000)
  0.772000   0.000000   0.772000 (  0.772000)
  0.762000   0.000000   0.762000 (  0.762000)

$ bin/jruby.sh --server -Xcompile.invokedynamic=true 
bench/bench_fib_recursive.rb 10 35
  0.912000   0.000000   0.912000 (  0.879000)
  0.787000   0.000000   0.787000 (  0.787000)
  0.786000   0.000000   0.786000 (  0.786000)
  0.789000   0.000000   0.789000 (  0.789000)
  0.789000   0.000000   0.789000 (  0.789000)
  0.791000   0.000000   0.791000 (  0.791000)
  0.788000   0.000000   0.788000 (  0.788000)
  0.788000   0.000000   0.788000 (  0.788000)
  0.787000   0.000000   0.787000 (  0.787000)
  0.802000   0.000000   0.802000 (  0.802000)

_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to