Created
September 1, 2014 21:51
-
-
Save bkirkby/7e4391e4b89f6def1291 to your computer and use it in GitHub Desktop.
autoboxing effects on performance in java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestAutoBox { | |
public static void main( String[] args) { | |
long timerStart = System.currentTimeMillis(); | |
Integer min = Integer.MAX_VALUE; | |
//int min = Integer.MAX_VALUE; | |
for(int i=Integer.MAX_VALUE; i>=0; i--) { | |
min = i<min?i:min; | |
} | |
System.out.println( System.currentTimeMillis() - timerStart); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment