Skip to content

Faster Date::from_julian_day using Ben Joffe's algorithms? #758

@madsmtm

Description

@madsmtm

I stumbled upon this article on Hack News today.

In it, Ben Joffe discusses a lot of tricks to speed up int -> date parsing, specifically the calculation in Date::from_julian_day_unchecked that time currently implements using Peter Baum's algorithms IIUC. Ben Joffe also has two earlier articles detailing tricks for operating in the 32-bit range (which are probably more relevant in time's case).

Idk., I thought you might be interested in it, especially since operations like Date::checked_add are implemented in terms of this conversion - but feel free to close this issue if you don't think it's worth it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-coreArea: anything not otherwise coveredA-perfArea: performanceC-enhancementCategory: an enhancement with existing code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions