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

Persistent map file using custom marshaller is significantly larger than a using built-in one #197

Open
edudar opened this issue Sep 25, 2019 · 2 comments
Labels

Comments

@edudar
Copy link
Contributor

edudar commented Sep 25, 2019

I created two maps. One is ChronicleMap<IntValue, Boolean> and another one is ChronicleMap<IntValue, CustomData>. There's also a custom marshaller for CustomData that writes 0 bytes effectively creating a set from a map. That is confirmed in preMapConstruction() when averageValueSize is calculated and it is 0.0. After that, I initialize both maps with 2M, 20M, 200M, and 2B entries on MacOS 10.14. Here's what file sizes look like:

. 2M 20M 200M 2B
Boolean 35.7MB 325.1MB 4.05GB 36.08GB
CustomData 43.3MB 397.9MB 4.76GB 43.18GB

So even when the custom object and its marshaller supposed to take less space, their map file is 20% larger.

Another experiment was with <IntValue, Integer> and <IntValue, Byte> maps. There's no built-in marshaller for Byte, so I created one based on IntegerMarshaller just swapping Integer with Byte and setting the size to 1L instead of 4L.

. 2M
Integer 41.9MB
Byte 45.6MB

That just does not make sense.

@JerryShea
Copy link
Contributor

@edudar is this still a relevant question for you?

@edudar
Copy link
Contributor Author

edudar commented Oct 10, 2023

I moved away from where I needed ChronicleMap about 2 years ago, so it's not relevant to me personally, but it might be in general.

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

No branches or pull requests

3 participants