← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/request_supply_opt into lp:widelands

 

So I made a bit of profiling, first of all it seems the game (drawing itself) takes quite a lot of CPU time - perhaps problem on my side? Tests run for 3 minutes of gameplay, but loading took also quite a bit of time (not counted in 3 minutes)....

But results:
I compared
1. trunk + crater (small map after 45 min)
2. trunk + Cristobals sea (512x512 after 4 hours)
3. request_supply_opt + Cristobals sea (512x512 after 4 hours)

I used savegames...

I picked only 3 functions here, look at second column (cummulative %)

trunk+crater:
[79]     1.8    0.00    0.17    4530         DefaultAI::think() [79]
[90]     1.6    0.00    0.14   37761         Widelands::Economy::_find_best_supply()
[94]     1.6    0.00    0.14    5494         Widelands::Economy::find_route()

trunk + big map (Cristobals sea)
[16]    22.8    0.00    8.43  105284         Widelands::Economy::find_route()
[24]    17.5    0.26    6.20 1145776         Widelands::Economy::_find_best_supply() [24]
[65]     3.8    0.02    1.38   22120         DefaultAI::think()

this branch + big map (Cristobals sea)
[20]    15.7    0.00    5.76  112254         Widelands::Economy::find_route()
[24]    14.8    0.39    5.06 1302844         Widelands::Economy::_find_best_supply()
[61]     4.3    0.00    1.59   33740         DefaultAI::think() [61]


My conclusions:
On big maps, _find_best_supply takes significant portion of CPU time, many fold then AI.
My changes as they are now, brings reduction about 20% of _find_best_supply and about 35% of find_route() + on big maps.

I believe implementing a treshold would help to further reduction.....
-- 
https://code.launchpad.net/~widelands-dev/widelands/request_supply_opt/+merge/280193
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/request_supply_opt.


References