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

Introduce new property 'subzero.referenceresolver.class' where we could specify Kryo's ReferenceResolver implementation #25

Merged
merged 2 commits into from
Oct 5, 2018

Conversation

acieplak
Copy link
Contributor

@acieplak acieplak commented Oct 4, 2018

No description provided.

…ld specify Kryo's ReferenceResolver implementation.
@acieplak
Copy link
Contributor Author

acieplak commented Oct 4, 2018

Hi,

It's rather an enhancement request, but in KryoStrategy#newKryoInstance() we create a Kryo with default MapReferenceResolver. I have found out that in some cases this implementation is a lot more slowly than others, e.g. ListReferenceResolver. The difference sometimes is about 10 times, which is a lot.
It would be nice to have some kind of system property, e.g. a subzero.referenceresolver.class where we could specify which ReferenceResolver implementation should be used.

@acieplak acieplak closed this Oct 4, 2018
@acieplak acieplak reopened this Oct 4, 2018
@acieplak
Copy link
Contributor Author

acieplak commented Oct 4, 2018

Hi, this PR is a followup to the issue #24

@@ -41,10 +47,10 @@ private Kryo newKryoInstance() {
kryo = new Kryo();
} else {
ClassLoader classLoader = ClassLoaderUtils.getConfiguredClassLoader(hazelcastInstance);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt you respect the properties even when the IGNORE_HAZELCAST_CLASSLOADER is set to true ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. We could assume that the property com.esotericsoftware.kryo.util.MapReferenceResolver should ignore whether the Hazelcast class loader is ignored or not as we care only about the ReferenceResolver.
So in line 42 we should have sth like this:

kryo = new Kryo(createReferenceResolver());

Do you agree?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. ☝️ looks good.
thanks for the PR!

@acieplak
Copy link
Contributor Author

acieplak commented Oct 5, 2018

Hi,
Could you let me know if you would like to merge this pr and accordingly release a new version? And if so when could I expect this to happen?
Best regards,
Adrian

@jerrinot jerrinot merged commit 3e7d88c into jerrinot:master Oct 5, 2018
@jerrinot
Copy link
Owner

jerrinot commented Oct 5, 2018

thanks for the PR, I will push a new release out today!

@jerrinot
Copy link
Owner

jerrinot commented Oct 5, 2018

@acieplak: I just released 0.8 version with your fix. it should appear in Maven Central in a short while.

@acieplak
Copy link
Contributor Author

acieplak commented Oct 5, 2018

Hi,

I'm glad to hear that. Thanks a lot :-)

Best regards,
Adrian

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