Skip to content

Feature: Object support #17

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

FxMorin
Copy link

@FxMorin FxMorin commented Mar 3, 2025

This PR adds primitive support for maps using objects in either the keys or values.
The performance benefits are still clearly there, while providing less memory usage.

Other changes:

  • The readme has been modified to show performance benchmark results for object keys.
  • Added ConcurrentMap comparison in JMH benchmark. Since its also a viable alternative (when not considering memory).
  • Cleaned up the builder code to reduce DRY

This PR drastically changes the structure of the code, and would require a major version change.

@magicprinc
Copy link

magicprinc commented Mar 31, 2025

@FxMorin Please, see also optimized “slim” version: https://github.com/magicprinc/fastutil-concurrent-wrapper

less code and RAM (fewer wrappers)

Branch "dev" has ultimate "zero fat" version.

PS: for long→object Maps you could find jctools' org.jctools.maps.NonBlockingHashMapLong interesting too.

@magicprinc
Copy link

magicprinc commented Apr 13, 2025

@FxMorin Please see https://github.com/magicprinc/fastutil-concurrent-wrapper/blob/master/src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/StripedNonBlockingHashMapLong.java

I would be very happy if you write more tests for this class 🙏

Benchmark StripedNonBlockingHashMapLong vs ConcurrentLongObjectMap is also very welcomed

As you can see, jars are available at
https://jitpack.io/#magicprinc/fastutil-concurrent-wrapper

@magicprinc
Copy link

@FxMorin If you see other classes: they are extremely compact now (several times shorter than originals). So it's very easy to add every other missing key-value combination.

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

Successfully merging this pull request may close these issues.

2 participants