Topic: Performance regression
GunChleoc |
Posted at: 2018-02-17, 21:17
The branch that you created when this was last discussed https://code.launchpad.net/~widelands-dev/widelands/ware_routing_speedup Busy indexing nil values Top Quote |
Tibor |
Posted at: 2018-02-17, 21:29
I was confused because of the title of bug. I believed the game saving itself is CPU intensive... As for my branch, this can be enabled via commandline swith or even GUI checkbox as an "experimental" feature. But I am not sure whether anybody will be able by watching the game see that it behaves differently. And for ~99% of wares delivered there should be no difference (the same ware would be picked out by old algorithm). Top Quote |
GunChleoc |
Posted at: 2018-02-18, 08:11
I am against a command line switch if we can make this work out of the box. We could switch it on automatically either when the FPS gets low, or if an economy has more than x flags or roads, or for big maps. If we do a dynamic switching, we need to make sure that it's OK for multiplayer too - I don't know if it would affect the sync without having a look. Or if it's really ~90%, let's just have it on always. ETA: It does affect multiplayer, because it comes from CmdCallEconomyBalance. So, we'd need to parametrize that command if we make it dynamic. Edited: 2018-02-18, 08:15
Busy indexing nil values Top Quote |
Tibor |
Posted at: 2018-02-18, 19:51
Well, I would not go this way, just use plain treshold, like 10. If there are less then 10 providers - no difference, if more there might be difference. But it is implemented in the way:
So if supplier #4 is best (shortest route), it will test also #5, #6, #7. If another winner is found, it will test next 3 suppliers as well. Unless seafaring is involved there should be no big anomalies. And even if seafaring is involved there must be more suppliers then threshold to even have a chance of a difference. Top Quote |
GunChleoc |
Posted at: 2018-02-19, 09:38
OK, let's use a threshold by number of nodes per economy. Maybe weighted by number of players? Busy indexing nil values Top Quote |
Tibor |
Posted at: 2018-02-19, 11:11
What nodes do you mean? The beauty of the threshold is that while economy is small, there would be no "cut-offs". So threshold really had to be adjusted to big economies. I would not even consider the number of players, though this is not unreasonable idea... Top Quote |
GunChleoc |
Posted at: 2018-02-19, 16:02
I mean nodes = flags in the economy Busy indexing nil values Top Quote |
PkK Topic Opener |
Posted at: 2018-02-19, 16:31
Wouldn't using a threshold make maintenance and debugging harder? Why not just use one algorithm (i.e. the one without massive performance issues) all the time? Philipp Top Quote |
teppo |
Posted at: 2018-02-19, 18:11
I recommend testing the new code using the Galaxy map. Top Quote |
kaputtnik |
Posted at: 2018-02-19, 19:19
+1 Good candidates for testing are also:
Fight simulator for Widelands: |