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

Server's collections performance #112

Open
andreasdc opened this issue Dec 31, 2021 · 5 comments
Open

Server's collections performance #112

andreasdc opened this issue Dec 31, 2021 · 5 comments

Comments

@andreasdc
Copy link

What do you think about changing server's collections? Like player list or other collections, to the ones that have better performance? That would need heavy testing and benchmarks of course.

@Electroid
Copy link
Owner

You mean using fastutil in more places?

@andreasdc
Copy link
Author

You mean using fastutil in more places?

Yes, like player list and many other, but from what I see you can't just put fastutil in every scenario and hope it will work better. I may be wrong of course.

@andreasdc
Copy link
Author

andreasdc commented Jan 26, 2022

You mean using fastutil in more places?

I saw Paper uses fastutil in their version of PlayerChunkMap, I don't remember exact name of the new class, but I think it's PlayerChunk, it really looks like it.
There is fastutil for example in:
PacketPlayOutEntityDestroy
PacketPlayOutGameStateChange
PacketPlayOutMultiBlockChange
PlayerMap
NBTTagLongArray
Chunk
NBTTagList
@Electroid what do you think?

@Pablete1234
Copy link
Contributor

I believe the cost-benefit for this is between marginal and non-existant. Each change has high risk of breaking behavior, and very little to no gain for most cases. Only the hot pieces of code benefit from a change like this, and i believe we've already fixed those (and then broken them, and re-fixed them). If there's a specific proposal for one that can be replaced, alongside a profile that shows the performance impact, then by all means feel free to submit a PR or open a new issue with the specific case, but for the time being i believe this can just be closed.

@sunmisc
Copy link

sunmisc commented Apr 24, 2023

as for me the standard library should think about it, not third-party libraries

for example, the Valhalla project can "kill" collections for primitives, of course, this is loudly said, but it's better to update the jdk already
And yes, it's quite hilarious and hard to migrate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants