commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Commented] (MATH-650) FastMath has static code which slows the first access to FastMath
Date Sun, 11 Sep 2011 21:00:09 GMT


Gilles commented on MATH-650:


What the above shows is that preset tables are a significant improvement over the code as
it was before you raised this issue. However, Sebb came with the (undisputed) idea of IOD
_after_ implementing the (disputed) idea of preset tables. Thus, using the second JAR, you
again get a significant improvement, thanks to IOD.

What would definitely settle this discussion is to test the current code, once with {{FastMath.USE_PRECOMPUTED_TABLES}}
set to true and once set to false.
Both will use IOD, and the difference will be solely due to using preset tables versus computing
them at runtime.

> FastMath has static code which slows the first access to FastMath
> -----------------------------------------------------------------
>                 Key: MATH-650
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: Nightly Builds
>         Environment: Android 2.3 (Dalvik VM with JIT)
>            Reporter: Alexis Robert
>            Priority: Minor
>         Attachments:
> Working on an Android application using Orekit, I've discovered that a simple FastMath.floor()
takes about 4 to 5 secs on a 1GHz Nexus One phone (only the first time it's called). I've
launched the Android profiling tool (traceview) and the problem seems to be linked with the
static portion of FastMath code named "// Initialize tables"
> The timing resulted in :
> - FastMath.slowexp (40.8%)
> - FastMath.expint (39.2%)
>  \- FastMath.quadmult() (95.6% of expint)
> - FastMath.slowlog (18.2%)
> Hoping that would help
> Thanks!
> Alexis Robert

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message