Global reset

From Screeps Wiki
Revision as of 05:13, 5 February 2017 by Tedivm (talk | contribs) (Created page with "Global Resets are a byproduct of the loop architecture. They occur when the `global` object is cleared, which causes everything that was cached in it to get removed. When...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Global Resets are a byproduct of the loop architecture. They occur when the `global` object is cleared, which causes everything that was cached in it to get removed.

When the global object is reset it causes a spike in CPU usage as a number of items are no longer cached and must be regenerated, including-

  • Parsed code loaded through the `require` function.
  • Results of any code outside of the "loop" function,
  • Anything stored manually in the `global` object itself.

Global Resets occur whenever new code is uploaded to the server. They also occur infrequently over time.


Reset Storms

Every six hours a large cluster of global resets occurs, colloquially referred to as "reset storms". These clusters can have over a hundred global resets that happen almost every tick while this is ongoing. As the reset storms grew in size the developers began adding more CPU to player's buckets whenever they occurred, allowing players to use more of the bucket to offset the increase CPU load.