Perhaps the problems are with the way the Java program is written and run?
Back in 2012:
"5) The idea is to help you understand that you aren't comparing what you say you're comparing.
If your intention is to compare time taken to grow a list, then shouldn't you start with lists that are the same size, and start with program heap that's the same size, and use the same max heap size?
user+sys for your Java program = 20.56s
But change
ArrayList<Integer> s = new ArrayList<Integer>();
to
ArrayList<Integer> s = new ArrayList<Integer>(8192);
Back in 2012:
"5) The idea is to help you understand that you aren't comparing what you say you're comparing.
If your intention is to compare time taken to grow a list, then shouldn't you start with lists that are the same size, and start with program heap that's the same size, and use the same max heap size?
But change to and run with I don't think you're comparing what you say you're comparing."http://www.famzah.net/download/langs-performance/java-discus...