Skip to content

Instantly share code, notes, and snippets.

@bkirkby
Created September 1, 2014 21:51
Show Gist options
  • Save bkirkby/7e4391e4b89f6def1291 to your computer and use it in GitHub Desktop.
Save bkirkby/7e4391e4b89f6def1291 to your computer and use it in GitHub Desktop.
autoboxing effects on performance in java
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