[Mono-dev] DateTime.Now performance improvement.

Miguel de Icaza miguel at ximian.com
Tue Nov 21 18:07:13 EST 2006


Hello,

    The following patch helps in improving the performance of
DateTime.Now.   

    DateTime.Now does a lot of work currently as it needs to convert a
system time into the local time zone.  This patch caches a common value:
the current year at the time of initialization, and uses that fast code
path instead of the slower one most of the time.

    People running software that crosses the year boundary will still
get the slower version, I could fix that if we think its important.

Miguel.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: timezone-1.patch
Type: text/x-patch
Size: 4047 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061121/3e10a10e/attachment.bin 


More information about the Mono-devel-list mailing list