1
Coding / Re: Trying to speed up code for Routing
« on: March 26, 2017, 04:41:18 am »
I was going to add timing data to compare with and without the modification, then noticed a big fail in my comparison.
My first impression was just comparing the downloaded ufo2map (from downloads section) with the compiled with modifications, but the main difference on timing surely is due to the optimizations used by the compiler; my modification is just a very small improvement
Next you can find an example of timing (on my machine, taken from the log) using 3 copies of ufo2map.exe: the one I downloaded from downloads section, the one I compiled from source (unmodified source, using optimizations from compiler), and the one I compiled with my modification.
The 3 amounts of time are for map data, day light data and night light data; only the first timing is affected by the modified code. After map name, you can find timing with original ufo2map, self compiled from unmodified source, then timing with modified ufo2map.
"Mine.map", 34 + 66 + 61 = 161 seconds, 24 + 44 + 43 = 111 seconds, 21 + 44 + 43 = 108 seconds
Note how the timing for Lighting are the same for both .exe compiled on my machine, and the improvement is just the first part (from 24 to 21); at first I was comparing 34 to 21, so a bigger difference, and much bigger in % if you just take the part of the timing related to the Routing calculations.
Lesson learned: Don't use the compiled exes for windows users; better compile on my own (as linux users do).
My first impression was just comparing the downloaded ufo2map (from downloads section) with the compiled with modifications, but the main difference on timing surely is due to the optimizations used by the compiler; my modification is just a very small improvement
Next you can find an example of timing (on my machine, taken from the log) using 3 copies of ufo2map.exe: the one I downloaded from downloads section, the one I compiled from source (unmodified source, using optimizations from compiler), and the one I compiled with my modification.
The 3 amounts of time are for map data, day light data and night light data; only the first timing is affected by the modified code. After map name, you can find timing with original ufo2map, self compiled from unmodified source, then timing with modified ufo2map.
"Mine.map", 34 + 66 + 61 = 161 seconds, 24 + 44 + 43 = 111 seconds, 21 + 44 + 43 = 108 seconds
Note how the timing for Lighting are the same for both .exe compiled on my machine, and the improvement is just the first part (from 24 to 21); at first I was comparing 34 to 21, so a bigger difference, and much bigger in % if you just take the part of the timing related to the Routing calculations.
Lesson learned: Don't use the compiled exes for windows users; better compile on my own (as linux users do).