Skip to content

Comment on A Fast 64-Bit Date Algorithm (30–40% faster by counting dates backwards)

Comments

Interesting how it compares with the ClickHouse implementation, which uses a lookup table: https://github.com/ClickHouse/ClickHouse/blob/master/src/Com...

So that a day number can be directly mapped to year, month, and day, and the calendar date can be mapped back with a year-month LUT.

Simply, ClickHouse only works on a 399 years span while OP's algorith parses any date, over 3 trillion years.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.