tgstation / dev-cycles-initiative

Hub for tracking issues in the Dev Cycles Initiative
1 stars 0 forks source link

Lazy storage #13

Open Mothblocks opened 1 year ago

Mothblocks commented 1 year ago

Every storage item, such as toolboxes and backpacks (but not closets/crates) initializes all their contents immediately.

Estimated Cost

It's hard to estimate the cost because PopulateContents is tainted by objects like GAGS screwdrivers. The cost is AT MOST 846ms, but more likely around 700ms.

Solutions

The most obvious solution is to lazily initialize the contents of storage until requested. This would fix the issue, but it's not clear if the fragility of this approach is worth the cost.