Skip to content

perf(time): cache parsed relative time strings - #1052

Open
marco-c wants to merge 1 commit into
taskcluster:mainfrom
marco-c:cache_time_strings
Open

marco-c wants to merge 1 commit into
taskcluster:mainfrom
marco-c:cache_time_strings

Conversation

@marco-c

@marco-c marco-c commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

value_of parsed the same few relative time strings ("1 day", "28 days", ...) with a regex every time, although task definitions contain several of them and are resolved multiple times. Its results are timedeltas, which are immutable, so they are now cached.

On a typical task definition, resolve_timestamps takes 16.4us instead of 20.5us.

`value_of` parsed the same few relative time strings ("1 day",
"28 days", ...) with a regex every time, although task definitions
contain several of them and are resolved multiple times. Its results
are timedeltas, which are immutable, so they are now cached.

On a typical task definition, resolve_timestamps takes 16.4us instead of
20.5us.
@marco-c
marco-c requested a review from a team as a code owner September 29, 2026 13:40
@marco-c
marco-c requested a review from hneiva September 29, 2026 13:40

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant