Optimization for checkStructureAgainstController
-
Tower and lab (and maybe spawn?) intents are stupidly expensive (I've measured >0.35 CPU in some cases). This is because of
checkStructureAgainstController
. It can be easily optimized for RCL 8 rooms by one non-complicated line here: https://github.com/screeps/engine/blob/master/src/utils.js#L496if(roomController.level == 8) { return true; }
It seems silly to me our lab and tower intent cost should scale with number of structures in the room.
There's more optimizations you could do, but they'd require tracking stuff over time. Ideally you'll just call the override-able isActive(), but I guess that could lead to invalid intents being passed to the driver, and that's probably bad.
-
Bump.
-
It's already in our backlog. Thanks for reminding!
-
yeah, agree with @Tigga , looking at github/engine code makes me believe, that the same mechanism may be in use at MMO server side and addressing the issue may give a boost to overall performance of all the shards.
-
Did this ever make it into the game?