codeaudit / gwt-chronoscope

Automatically exported from code.google.com/p/gwt-chronoscope
GNU Lesser General Public License v2.1
1 stars 0 forks source link

Eliminate argument checking in JavaArray2D.get() when running in web mode #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On Nov-07-2008 Ray Cromwell wrote:

  it looks like the performance regression comes from the JavaArray2D.get() method. This 
method is called like 100x as many as other methods, but it produces 2x more 
calls to 
MathUtil.isBounded() which is not inlining for some reason.

  We should probably ensure that argument checking is switched off in web mode for 
performance, or based it on a global final (like 
ChronoscopeOptions.isArgumentCheckingOn()) I'll 
investigated why isBounded isn't getting inlined, but we should also move 
argument checking in 
production/web mode out of hot methods like get().  

I would implement ChronoscopeOptions.isArgumentCheckingOn() as "return 
!GWT.isScript()". 
This will evaluate to a constant "false" during GWT compilation, and prune 
those isBounded calls. 
Also, for any JVM with a JIT it can be made to optimize away.

Original issue reported on code.google.com by chadtaka...@gmail.com on 10 Nov 2008 at 11:08

GoogleCodeExporter commented 9 years ago
Resolved in r720.  See check-in comments for details.  ChartBench.java, running 
on a MacPro 2.66GHz system 
indicates these improvements:

    mean trial time:  OLD=4760ms,  NEW=3650ms
    Frames per sec:   OLD=21,  NEW=27

Original comment by chadtaka...@gmail.com on 11 Nov 2008 at 10:45

GoogleCodeExporter commented 9 years ago

Original comment by chadtaka...@gmail.com on 11 Nov 2008 at 10:45