I agree with Gun here from the design point of view. > productions site sends messages for all types of productionsites every time > the production fails - this is too many messages, and AI has to catch them, > find out if it is the right receiver, filter out non-mines, and finally > iterate over mines to find the right one. So much code, and (CPU) overhead in > comparison to may actual design.
Pff - one virtual function call and less than an hundred checks for each time a productionsite sends a message. This will not even show up in any profile. Code quality trumps performance until performance prooves to be an issue. > This is how you seems to undestand the work of a mine; my undestanding is: > SSSSSSFSSSSFSSFSSSFFSSSFFSFFFFSSFFFFFSFFFFFFF Well, Gun is closer it is: SSSSSSSSSSSSFFFFFFFFFFFFFFFFFFSFFFFFFFFFFFFFFFFSFFFFFFFFFFSFFSFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFSFFFFF. 5% - no need to keep track of it really. > I am trying to push the CPU utilization of AI down, so this is against my > effort. But I could live with it :( :( :( I am supportive of this. But profile before assuming what the bottlenecks are. -- https://code.launchpad.net/~widelands-dev/widelands/tibor-ai5/+merge/228762 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/tibor-ai5. _______________________________________________ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp