Go to file
Martin Reddy f7231263d4 Fix for DEV-39442: Increased the performance of LLDate::toHTTPDateString
by over 50 times.

Looking at the usage, toHTTPDateStream is not called anywhere (except
internally by toHTTPDateString), and toHTTPDateString is called only
once outside of lldate.cpp, by LLStringUtil::formatDatetime. Also, the
method is most commonly called with a single two-character token, such
as "%Y" or "%A".

I therefore removed toHTTPDateStream and optimized toHTTPDateString.
Setting the locale was the most expensive operation, so I looked into
caching that, both in terms of std::ostream and strftime. The timings
for those implementations (averaged over 10 calls) is:

toHTTPDateString timings:
 - with ostream (current)                -> 0.314156 ms
 - with ostream and std::locale caching  -> 0.033999 ms
 - with strftime and setlocale() caching -> 0.005985 ms

I therefore went with the standard C library strftime solution.

I also wrote a few unit tests to make sure that I didn't break any
existing functionality, and tested this under Windows and Linux.

Reviewed by steve.
2009-09-09 10:21:58 +00:00
doc DEV-34299 - VWR-13996: Avatars are invisible, except for attachments 2009-07-14 15:24:37 +00:00
etc svn merge -r 129841:129910 svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/pluginapi_05-merge@129910 2009-08-27 19:00:18 +00:00
indra Fix for DEV-39442: Increased the performance of LLDate::toHTTPDateString 2009-09-09 10:21:58 +00:00
scripts merge -r125267:125272 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/inventory-links__merge__viewer2.0.0-3-r125202 to svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3 2009-06-24 21:36:42 +00:00
install.xml svn merge -r130875:131962 svn+ssh://svn.lindenlab.com/svn/linden/branches/pluginapi/pluginapi_05_newllqtwebkit 2009-08-31 17:16:21 +00:00