Reforged-Hub / radium-upstream

A Forge port of mod designed to improve the general performance of Minecraft without breaking things
GNU Lesser General Public License v3.0
5 stars 0 forks source link

Poi Optimization request (Please backport too if older versions are still supported) #21

Open Speiger opened 9 months ago

Speiger commented 9 months ago

o/ ChunkPregen dev here working on increasing compat with the lithium ports a bit, and have fixed most of it.

For future versions I do have a request. Could you change the base implementation that you use for your ListeningHashMap from OpenHashMap to LinkedOpenHashMap? The idea being that you guys turn the Map into an access cache that moves the last accessed entries to the end while least used entries get pushed to the front of the iterator.

Because at the moment ChunkPregen when a Lithium mod is installed fights with the poi system over which pois should be removed. Because the ordering roughly always stays the same and ones that should be deleted stay more likely loaded then getting unloaded.

Here is the code required to make it work.

@Override
public V put(long k, V v) {
    return putAndMoveToLast(k, v);
}

@Override
public V get(long k) {
    return getAndMoveToLast(k);
}

I doubt you guys support past the latest version, but if you do it would be really epic if you could backport this too. Have a nice day :)

dima-dencep commented 9 months ago

I think you should direct this to lithium, we won't make that change as it would break parity with the original mod, but you can make pullrequest