3 ms·
Indeed! It was a while ago but Im quite proud of the fast timestamp functions I made for Java after the standard library timestamp performance turned out to be
by wood_spirit 3y ago
Indeed! It was a while ago but Im quite proud of the fast timestamp functions I made for Java after the standard library timestamp performance turned out to be critical to some data pipelines I was working on.
The early versions of the code did cache the last parsed date etc but as the parser got quicker this became diminishing returns.
The fastest way I found for the calendar month numbers etc was to use a precomputed table etc.
https://github.com/williame/TimeMillis https://github.com/williame/TimeMillis
- lichtenberger 3y agoWouldn't it be possible to contribute the faster algorithm to the JDK (e.g. the Instant class)? Maybe you'd need some iterations, but do you see any downsides?