I guess com.google.gwt.user.datepicker.client.CalendarUtil.getDaysBetween(Date, Date) was written with datepicker in mind, BTW I've seen some code making heavy use of that method, and its performance was badly impacted.
Since actual implementation internally instantiates two new dates per every invocation and then resets the time for each of them, I've simply rewritten the same logic avoiding date instantiation and time resets, and this gave me good results.
So I hope CalendarUtil.getDaysBetween() could be enhanced the same way.
Follows an excerpt of a naive test comparing one shot original vs optimized implementation... clearly this kind of measurement doesn't consider GC time (mainly induced by original implementation) so I'd consider its results pessimistic. Nonetheless running it with Chrome 37 on my host, the execution time of optimized code is almost constantly 25% of original one.
Talking about real world code instead, this change practically removed getDaysBetween effects from CPU profiling charts, while it was originally one of the main components.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To post to this group, send email to email@example.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.