SpongePowered / Sponge

The SpongeAPI implementation targeting vanilla Minecraft and 3rd party platforms.
MIT License
389 stars 211 forks source link

Use FastUtil rather than Trove for more memory efficient collections and maps. #586

Closed me4502 closed 8 years ago

me4502 commented 8 years ago

Whilst Trove has been around for a while, it isn't as actively developed anymore. FastUtil is much more recent, and actively developed.

On top of this, Trove doesn't hold up in terms of performance compared to more modern libraries. Here's an example of a benchmark that pits numerous libraries together,

http://java-performance.info/hashmap-overview-jdk-fastutil-goldman-sachs-hppc-koloboke-trove-january-2015/

Another option is Koloboke, which appears to include enhanced integration with JDK8.

me4502 commented 8 years ago

Koloboke is looking to be a better option, as the FastUtil jar is 17mb.

Zidane commented 8 years ago

@amaranth

Your thoughts on this?

stephan-gh commented 8 years ago

Koloboke's full JAR is even bigger (about 18 MB), so if we'd choose one of them we'd need to filter the unused classes out before shading, because that would be otherwise way to big to shade completely.

amaranth commented 8 years ago

Now that Minecraft is including a subset of fastutil it makes sense to use that in place of trove.

stephan-gh commented 8 years ago

Fixed in https://github.com/SpongePowered/SpongeCommon/commit/81e15b64da5b1c3dda4ec3cce2469cef13a4f0dd