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

Fix class path scaning on each deserialization #37

Merged
merged 1 commit into from Jul 18, 2023

Conversation

kostya05983
Copy link
Contributor

Hello, there is a problem with Json.createPatch(), it calls JsonProvider.provider() on each call.

Accordingly to java doc of provider() method: "Creates a JSON provider object. The provider is loaded using the ServiceLoader.load(Class) method. If there are no available service providers, this method returns the default service provider. Users are recommended to cache the result of this method.".

Let's cache it as static variable.

We faced with a lot of CPU issues because of this method.

What do you think about it?

@cowtowncoder
Copy link
Member

Thank you @kostya05983 -- this makes sense.

One quick clerical thing: unless I have asked for & received CLA before, we'd need it from here:

https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf

and the usual way is to print, fill & sign, scan/photo, email to info at fasterxml dot com.
Once we received it, I can proceed merging the fix.
Note that CLA only needs to be sent once before the first commit; if you have done it before just let me know name under which it was sent.
Either way, going forward sent CLA works so need not be sent again.

Thank you for providing this PR -- looking forward to merging it, for inclusion in 2.16.0!

@cowtowncoder cowtowncoder added 2.16 Intended for version 2.16.x cla-needed CLA needed from submitter labels Jul 13, 2023
@kostya05983
Copy link
Contributor Author

Thank you for your instructions @cowtowncoder, I've signed CLA and sent it to fasterxml dot com. I hope that everything is correct.

@cowtowncoder cowtowncoder removed the cla-needed CLA needed from submitter label Jul 18, 2023
@cowtowncoder
Copy link
Member

Thank you @kostya05983 CLA was fine! Merging.

@cowtowncoder cowtowncoder merged commit 03ecf2e into FasterXML:2.16 Jul 18, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.16 Intended for version 2.16.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants