Skip to content

improve performance of the date/time transformer during feature decoding#559

Open
cportele wants to merge 1 commit into
masterfrom
parse-date-time
Open

improve performance of the date/time transformer during feature decoding#559
cportele wants to merge 1 commit into
masterfrom
parse-date-time

Conversation

@cportele

Copy link
Copy Markdown
Contributor

The DATE_FORMAT value transformer did avoidable work for every value:

  • it rebuilt the input parser and the output formatter on each call;
  • parse() used parseBest with OffsetDateTime/LocalDateTime/LocalDate queries, so every value without an offset threw - and filled in a stack trace - before falling through to the next query.

Now the input parser is a shared constant, the output formatter is cached per transformer, and parse() resolves the value once and branches on the fields that are present (offset / time / date) instead of throwing. parse() keeps its signature for its other caller; output is unchanged.

The DATE_FORMAT value transformer did avoidable work for every value:

- it rebuilt the input parser and the output formatter on each call;
- parse() used parseBest with OffsetDateTime/LocalDateTime/LocalDate
  queries, so every value without an offset threw - and filled in a
  stack trace - before falling through to the next query.

Now the input parser is a shared constant, the output formatter is cached
per transformer, and parse() resolves the value once and branches on the
fields that are present (offset / time / date) instead of throwing.
parse() keeps its signature for its other caller; output is unchanged.
@cportele cportele requested a review from azahnen as a code owner June 29, 2026 11:29
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