-
Notifications
You must be signed in to change notification settings - Fork 625
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
Allocations optimization for converters #34
base: master
Are you sure you want to change the base?
Conversation
Parser for CharSequence to double
Made use of cached char values
Made use of cached values for double that are integers, removed costly regexp pattern checker.
Made use of cached values
Made use of reusable buffers
Made use of reusable buffer
Made use of reusable buffer, removed costly String::substring calls
See pull request Allocations optimization for converters quickfix-j#34
See pull request Allocations optimization for converters quickfix-j#34
See pull request Allocations optimization for converters quickfix-j#34
See pull request Allocations optimization for converters quickfix-j#34
Thanks for the PR (or actually the PRs ;)) |
Hello, Regarding QuickFix, I may have a fix to commit because of a regression on my changes, regarding double to String conversion, for DoubleField. May be, I have to check what kind of code I gave you for this specific part because the DoubleField optimization is the only piece that I didn’t took from the code I wrote in my work... In prod I made a mistake and we converted double values to string using String.valueOf(), but a NumberFormat must be used instead. For you question, I obviously know the difference between StringBuffer / Builder, I use the Builder when I can. Where did you see that I use a Buffer ? If I did it there is likely a reason, certainly the code below is not compliant with Builder but only Buffer. This is the case for DateTIme formatting, from what I remember. public abstract StringBuffer format(Date date, StringBuffer toAppendTo, There is something you have to know with my code there, the FieldPosition argument give my difficulties. I wanted to give the same one by default as the JDK do, but this is not an instance accessible without introspection. And we cannot build the same one as the JDK do because of accessibility restrictions. But the one I one use seems to be working fine : private static final class DontCareFieldPosition extends FieldPosition {
} Regards, Charles Briquel
|
We can use reflexion to resolve Builder issue and avoid a copy of date between StringBuffer - StringBuilder in |
Made use of cached string values & thread local buffers to avoid frequent allocations.