3 ms·
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 s
by threeseed 12y ago
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.
- super_tycoon 12y agoI 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://pastebin.com/w2BC8fNg http://www.reddit.com/r/programming/comments/2pvf68/armv7_vs_x8664_pathfinding_benchmark_of_c_d_go/cn0ft71 http://www.reddit.com/r/programming/comments/2pvf68/armv7_vs...