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

StdDateFormat: performance improvement of '_format(..)' method #1749

Closed
brenuart opened this issue Aug 24, 2017 · 3 comments
Closed

StdDateFormat: performance improvement of '_format(..)' method #1749

brenuart opened this issue Aug 24, 2017 · 3 comments
Milestone

Comments

@brenuart
Copy link
Contributor

The _format(..) method creates a new GregorianCalendar instance for every invocation. Performance would be better if the calendar is reused across invocations just like what is done with the DateFormats.

Without this optimisation, the performance are roughly the same as the SimpleDateFormat. With the optimisation, the StdDateFormat becomes 300% faster...

@cowtowncoder
Copy link
Member

Ok good to know, thank you for measuring it. It sort of makes sense as almost everything to do with date/time handling appears to be.... rather expensive. Need to figure out proper way to achieve that but hopefully is doable.

@brenuart
Copy link
Contributor Author

Check the PR ;-)

@cowtowncoder
Copy link
Member

Ah! Only catching up on updates :)

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

No branches or pull requests

2 participants