pmmp/PocketMine-MP

Get rid of cached resolved `CompressBatchPromise`s from `ChunkCache`

Opened this issue · 0 comments

Problem description

We currently keep around a lot of boxed caches inside resolved CompressBatchPromises.
These objects are a waste of memory and take a toll on the GC.

They also force the use of closures to retrieve promise values, which means even more useless objects if the cache has already been populated.

Proposed solution

This kind of change should be done in ChunkCache. It may cause some complexity increase, but the reduction in object allocations is worthwhile in hot paths.

Alternative solutions that don't require API changes