Here is a patch to save calls to karte_t::lookup during vehicle movement. The idea is that the routines hop() and betrete_feld() return the grund_t* pointer to the tile the vehicle moved to. Currently, when a vehicle changes to another tile karte_t::lookup is called multiple times during the chain of betrete_feld() calls. This patch saves A LOT of calls to karte_t::lookup. (More than 50% of calls for program without graphics)
Is it intentional that citycars no longer count as convoys passing for the waystats?
Otherwise, looks ok. I did a quicky profile using the yoshi game and my split apart/instrumented sync_step work patch which shows ~0.5% improvement to the overall sync_step time. ~1% faster for convois, ~2% citycars, but ~1.5% slower for pedestrians. Strange that last...
I'd appreciate a quick commit on this if possible, it's smack dab in the middle of my work on multithreaded sync_step which I've finally got around to resuming.
here is an update.
Now, citycars count again as convoys for way stats. I removed the check at the beginning of stadtauto_t::hop(), as the very same check is already done in hop_check.
waystats ok now. Repeated the profile - now 0.8% overall, 1.5% convoy, 0% citycar, 0.5% faster peds. Patch/nopatch difference is down in the noise of what I can measure. But, it's theoretically faster, and does hint at being measurably faster.
This is now in trunk, r 6338.