So I went ahead and created a code project article based on my last two blog posts and have been fairly please with the response and feed back.  One of the feedback posts was from a guy named Bernhard Hofmann about my use of DateTime.Now to get the tick's for part of the unique viewstate key.

To quote his message here:

I noticed your use of DateTime.Now in a few places and wanted to suggest (this is such a little point) the use of DateTime.UtcNow for a few reasons:

  1. UtcNow is faster than Now. This may not make much difference when you're doing file IO, but you don't need the UTC to local conversion overhead.
  2. I like to use UTC to remind other web developers that our sites are usually global.
  3. Using UTC avoids issues you may encounter when clocks change at your server location.

I started pondering this and had to ask myself "Honestly, how much faster can UtcNow really be?  So I write a little test harness to determine for myself...

captured_Image.png

And so there you have it.. a million iterations spread across 5 separate test runs, proves that UtcNow is indeed faster (almost twice as fast) as regular Now.  Granted, I realize that I'm measuring the out come of these tests in processor ticks, and that the actual "real world" difference is actually rather minute.. but let's face it, when you're trying to optimize your production application to get every last bit of performance out of it that you possibly can...

Every tick counts.....

Download Sample Code (12k)