How to lower CPU usage



  • I've been playing for a while and recently acquired a second room. My CPU often sits at 13, and spikes to 16-ish. I want to add a third room, and still haven't reached 6th level, so I need a way to lower my CPU usage so I can add more to my code. I would appreciate any help



  • Hello there,

    Optimizing CPU usage is one of the key challenges in the game. Without seeing your code, I can just say basic things.

    • Cache what you can
    • Check if you have CPU intensive functions which are not needed to call each cycle
    • Join the Screeps discord server, and check the #cpu-clinic thread


  • @virus_377b2d

    I agree with the points left by @Bazsi1224 . I am in a similar spot with my code. I was able to pretty easily add the profiler linked on the "Third Party Tools" part of the documentation site. It's a quick setup and can point you in the direction of function calls that are eating up larger portions of your CPU. Hope this helps.