harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [perf] Comparative benchmarking
Date Mon, 05 Nov 2007 14:10:00 GMT
Xiao-Feng Li wrote:
> A quick check shows that lots of time is spent in sqrt() computation:
> 
>  	hyluni.dll!___ieee754_sqrt()  + 0x1f3	C
>  	hyluni.dll!_fdlibm_sqrt()  + 0x11	C
> 	hyluni.dll!internal_sqrt(double arg1=1528.7960683139602)  Line 301 + 0xe	C
>  	hyluni.dll!Java_java_lang_Math_sqrt(const JNINativeInterface_ * *
> env=0x0206aaa0, _jobject * jclazz=0x0013f5b0, double
> arg1=1528.7960683139602)  Line 596 + 0xe	C
>  	0345c1b2()	

In this micro-bench ...

======================================================================
public static void main(String[] args) {

    // warm-up
    double result = 0.0d;
    for (int i = 0; i < 10000; i++) {
        result += Math.sqrt((double) i);
    }

    // Timed run
    result = 0.0d;
    long start = System.currentTimeMillis();
    for (int i = 0; i < 1000000; i++) {
        result += Math.sqrt((double) i);
    }

    System.out.println("Result = " + result + " in "
               + (System.currentTimeMillis() - start) + "ms");
}
======================================================================


Harmony 5.0 M3 prints
    Result = 6.666661664588418E8 in 1352ms
IBM 5.0 SR5a prints
    Result = 6.666661664588418E8 in 40ms
Sun 1.6.0-b105 prints
    Result = 6.666661664588418E8 in 40ms


Can we squeeze a bit more out of the JIT?

Regards,
Tim






Mime
View raw message