Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Managed to get a 22% improvement on Core i7 OSX / Oracle JDK8 by replacing the for iterator-style loop with a C style one. Am I missing something because this shouldn't be faster.

  	ArrayList<route> neighbours = nodes.get(nodeID).neighbours; 
	for(int i=0;i<neighbours.size();i++){
		route neighbour = neighbours.get(i);
Also add -Xbatch as a parameter which gives another few percentage points.


I refactored it to be more static and final/const. Also used an int[][] for the node data.

Original comment is on proggit. Went from 1600ms to 900ms.

http://pastebin.com/w2BC8fNg

http://www.reddit.com/r/programming/comments/2pvf68/armv7_vs...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: