-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
ContentTypeEngine improvement #534
Comments
The performance gain is very good, but I wonder if it doesn't come with a penalty. Maybe we miss something. |
Hi @decebals ! I created an MR for you to take a look. Another thing ... but for another issue ... to be able to customize the engine. In my case I need to make extra configurations in GsonBuilder. What do you think? |
@mhagnumdw Thanks for PR. It's good.
Yes. It's also a good idea. I want the developer to have total control for almost everything in Pippo (to be able to create an instance of |
MR #535 solves this. |
Hi!
As an example I will take GsonEngine, but it must be valid for all implementations of ContentTypeEngine.
With each call to the
fromString
andtoString
methods, theGsonBuilder
andGson
objects are created. Maybe it is good to cacheGson
.Below is a simple benchmark with 1,000,000 times:
GsonBuilder and Gson created inside the loop (not reusing)
Result
GsonBuilder and Gson created out of the loop (reusing)
Result
Now I ask myself: given this time difference will it be worth it?
The text was updated successfully, but these errors were encountered: