|
|
|
[
Permlink
| « Hide
]
Peter Brant - 29/Oct/07 09:23 PM
Attached patch adds c-call/c-return traces to InvocationMethodFactory. Test case will be forthcoming (basically we need to make test_trace_func.rb work again).
Wow, ambitious of you to dig into ASM. I don't suppose you've run any perf numbers with this, have you?
Ideally in 1.1b1, but it's not critical for the beta. Looks like it slows down method dispatch by about 5% with the server JVM or half that with the client JVM (constant tax, but twice as slow overall).
Server JVM with patch: C:\eclipseWorkspaceQT\jruby_trunk\test\bench>..\..\bin\jruby
-J-server -J-Djruby.jit.enabled=false bench_method_native_only.rb
Test STI: 400k loops accessing a fixnum var and calling to_i 100 times
6.810000 0.000000 6.810000 ( 6.810000)
6.890000 0.000000 6.890000 ( 6.890000)
6.750000 0.000000 6.750000 ( 6.750000)
6.759000 0.000000 6.759000 ( 6.759000)
6.750000 0.000000 6.750000 ( 6.750000)
Server JVM w/o patch: C:\eclipseWorkspaceQT\jruby_trunk\test\bench>..\..\bin\jruby
-J-server -J-Djruby.jit.enabled=false bench_method_native_only.rb
Test STI: 400k loops accessing a fixnum var and calling to_i 100 times
6.660000 0.000000 6.660000 ( 6.660000)
6.499000 0.000000 6.499000 ( 6.509000)
6.410000 0.000000 6.410000 ( 6.410000)
6.419000 0.000000 6.419000 ( 6.419000)
6.409000 0.000000 6.409000 ( 6.409000)
Client JVM with patch C:\eclipseWorkspaceQT\jruby_trunk\test\bench>..\..\bin\jruby
-J-Djruby.jit.enabled=false bench_method_native_only.rb
Test STI: 400k loops accessing a fixnum var and calling to_i 100 times
12.758000 0.000000 12.758000 ( 12.758000)
12.909000 0.000000 12.909000 ( 12.909000)
12.788000 0.000000 12.788000 ( 12.788000)
12.768000 0.000000 12.768000 ( 12.768000)
12.849000 0.000000 12.849000 ( 12.849000)
Client JVM w/o patch: C:\eclipseWorkspaceQT\jruby_trunk\test\bench>..\..\bin\jruby
-J-Djruby.jit.enabled=false bench_method_native_only.rb
Test STI: 400k loops accessing a fixnum var and calling to_i 100 times
12.629000 0.000000 12.629000 ( 12.629000)
12.528000 0.000000 12.528000 ( 12.528000)
12.518000 0.000000 12.518000 ( 12.518000)
12.528000 0.000000 12.528000 ( 12.528000)
12.758000 0.000000 12.758000 ( 12.758000)
MRI: C:\eclipseWorkspaceQT\jruby_trunk\test\bench>ruby bench_method_native_only.rb Test STI: 400k loops accessing a fixnum var and calling to_i 100 times 12.528000 0.000000 12.528000 ( 14.911000) 12.498000 0.000000 12.498000 ( 12.598000) 12.508000 0.000000 12.508000 ( 12.598000) 12.498000 0.000000 12.498000 ( 12.639000) 12.618000 0.000000 12.618000 ( 12.788000) (test was taken from bench_method_dispatch.rb) Please disregard patch. I have the bytecode transformation approach mentioned earlier mostly implemented. Will post for comments in a couple of days.
Sorry, revisit this one more time and we'll get it in. Email me directly if you don't see action.
Punting to 1.1, but still waiting on a final version based on recent trunk. Peter, if you get around to this bug me until it's committed and we can put it to rest. Others: if you want to update this for trunk, it would be a big help.
|
|||||||||||||||||||||||||||||||||||||||||||||||||