Skip to content

Instantly share code, notes, and snippets.

@PASTJL
PASTJL / Main.java
Created February 1, 2013 18:03
Test String.substring with JDK 1.7.0_6+ and JDK 1.6.38 <PathToJdk6/7>java -Xms128M -Xmx128M teststring.Main 100000 1000000 On my desktop: jdk 1.7.0_11 => 33 seconds / 252 KBytes Memory jdk 1.6.0_38 => 25 milliseconds / 782 KBytes Memory 1000 times faster ! ( Ok! for this stupid test ;-) )
package teststring;
import java.util.Random;
public class Main {
private static long now() {
return System.currentTimeMillis();
}
/**