FWIW: we don&#39;t cache the system time because it&#39;s slow to *get* it -- we cache it because it&#39;s slow to turn it into a text string (for HTTP responses, logging, etc). It still may be a stupid thing to do, but it benchmarked faster when I wrote it.<div>
<br></div><div>G<br><br><div class="gmail_quote">On Fri, Aug 5, 2011 at 7:47 PM, Bryan O&#39;Sullivan <span dir="ltr">&lt;<a href="mailto:bos@serpentine.com">bos@serpentine.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Fri, Aug 5, 2011 at 7:57 AM, Greg Weber <span dir="ltr">&lt;<a href="mailto:greg@gregweber.info" target="_blank">greg@gregweber.info</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><br></div><div>We are finally getting around to implementing a robust logging solution within Yesod. This creates the issue of having to frequently access the system time. I see that Snap has a separate thread to get the system time and cache the result [1].</div>

</blockquote><div><br></div></div><div>That is an absurd non-optimisation. It costs just a few dozen nanoseconds to get the time of day under OS X, and Linux should be even cheaper since it doesn&#39;t involve a system call. It wouldn&#39;t surprise me if the approach above is actually <i>slower</i>.</div>

</div>
<br>_______________________________________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Gregory Collins &lt;<a href="mailto:greg@gregorycollins.net" target="_blank">greg@gregorycollins.net</a>&gt;<br>
</div>