Watch out for sprintf()!

I was looking at some code the other day that does string concatenation with StringCchPrintf(“%s%s”).  I can imagine how this would have near optimal performance, and a hopeful developer could easily assume that in fact it has been tuned for this kind of concatenation.  But measuring tells all.  Three trivial implementations of concat using strsafe.h:void…


Performance work is slippery

… like a water snake.  Which is why we measure, measure and measure again.  Even the most obvious rule of thumb can be wrong.  I was optimizing some string parsing code (which is almost always ripe for optimization), and trying to reduce the cost of traversing a string.  When iterating over the elements of an…

1

The Bizarre and Unhappy Story of ‘file:’ URLs

For my first blog entry, I will start with something I wrote for my team back in 1997 (reedited for this blog) that has been helpful to generations of subsequently bewildered developers: Go back to 1995 and a small team dreaming an impossible dream of the Internet on Windows!  URLs were young, so young they still hadn’t…

6