in reply to high speed/efficiency http date to unix time, leap years handling?

If you're doing it this many times/second, I'd use two lookup tables. One mapping the date to unix time (at midnight), and one to map "HH:MM:SS" to a number of seconds. There are about 25000 dates in the range, and only 86400 different "HH:MM:SS" values (86401 if you want to have an entry for leap seconds). Then, once your tables are done, you only need to extract two parts of the strings, do two lookups, and one addition.

This ignores timezones, but I didn't spot any timezone processing in your code either.

  • Comment on Re: high speed/efficiency http date to unix time, leap years handling?