4 ms·
Had Microsoft used common sense, they would not store the string representation of a date as an integer, period.
by sparkie 5y ago
Had Microsoft used common sense, they would not store the string representation of a date as an integer, period.
- jeroenhd 5y agoIt depends on the use case. If this is an index that's commonly sorted by and enumerated, the performance impact of a string compare versus a simple 64 bit integer compare would be enormous. A single compare instruction versus a series of unicode character comparison operations with subsequent jump instructions would not only be more code, it would also be more likely to wreck the branch predictor of the CPU with all the added conditionals. I think using 64 bit integers for their natural hardware-accelerated sortability is quite a neat trick. You just have to be sure to use actual 64 bit numbers, and you have to think ahead to check if your data type is wide enough to actually contain your data.