Hehe I just read the original piece of code that sparked this debate. Godparticle, you desperately a little practical programming experience (and some humility).
Rogean's solution is a simple sprintf which will finish in (conservatively) 500 cycles or 100ns. Your solution requires a database lookup, with multiple locks/unlocks. You even mentioned the HARD DRIVE. If the hard drive is invovled we're talking on the order of milliseconds which would make your solution 10,000 times slower. But more probably the DB would cache stuff in RAM so your solution would only be 500x slower.
|