Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Speiger opened this issue Feb 18, 2024 · 1 comment
Labels
enhancement New feature or request upstream

Comments

@Speiger
Copy link

Speiger commented Feb 18, 2024

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 :)

@Speiger Speiger added the enhancement New feature or request label Feb 18, 2024
@Speiger Speiger changed the title Poi Optimization request (Please backport too if older versions are still supported) #214 Poi Optimization request (Please backport too if older versions are still supported) Feb 18, 2024
@dima-dencep
Copy link
Member

dima-dencep commented Feb 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upstream
Projects
None yet
Development

No branches or pull requests

2 participants