harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evgeniya Maenkova (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-5478) [classlib] [luni] Math.floor/ceil/rint can be implemented w/o JNI calls
Date Fri, 08 Feb 2008 23:48:07 GMT
[classlib] [luni] Math.floor/ceil/rint can be implemented w/o JNI calls
-----------------------------------------------------------------------

                 Key: HARMONY-5478
                 URL: https://issues.apache.org/jira/browse/HARMONY-5478
             Project: Harmony
          Issue Type: Improvement
          Components: Classlib
            Reporter: Evgeniya Maenkova
         Attachments: luni.math.2

With this improvement the test mentioned below shows 17% boost on my laptop.


package math;

public class Floor {
    public static void main(String[] args) {
    	double d1 = -123123.234;
    	double d2 = 1231233.123123;
    	double d3 = 23423.23;
    	for (int i = 0; i < 2500 * 2500; i ++) {
    		Math.floor(d3);
			Math.ceil(d1);
			Math.rint(d1);
    		Math.floor(d2);
			Math.ceil(d2);
			Math.rint(d2);
			Math.floor(d3);
			Math.ceil(d3);
			Math.rint(d3);
		}
    	
		long start = System.currentTimeMillis();		
		for (int i = 0; i < 2500 * 2500; i ++) {
			Math.floor(d3);
			Math.ceil(d1);
			Math.rint(d1);
  		    Math.floor(d2);
			Math.ceil(d2);
			Math.rint(d2);
			Math.floor(d3);
			Math.ceil(d3);
			Math.rint(d3);
		}
		System.out.println("floor result: " + (System.currentTimeMillis() - start));				
	}
}



Administrator@EGMAENKO-MOBL /cygdrive/c/ecl_311_ws/MicroBenches/bin1
$ /cygdrive/c/home_test/temp_builds/egm_r618602/bin/java -Xem:server math.Floor

floor result: 17359

Administrator@EGMAENKO-MOBL /cygdrive/c/ecl_311_ws/MicroBenches/bin1
$ /cygdrive/c/home_test/temp_builds/egm_r618602_Mj_Mc/bin/java -Xem:server math
.Floor
floor result: 14876

Administrator@EGMAENKO-MOBL /cygdrive/c/ecl_311_ws/MicroBenches/bin1
$


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message