Get rid of cached resolved CompressBatchPromise
s from ChunkCache
#6578
Labels
Category: Network
Related to the internal network architecture
Performance
Type: Enhancement
Contributes features or other improvements to PocketMine-MP
Problem description
We currently keep around a lot of boxed caches inside resolved
CompressBatchPromise
s.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
The text was updated successfully, but these errors were encountered: