Repository navigation
Conversation
alextwoods
approved these changes
Nov 10, 2026
alextwoods
left a comment
Contributor
There was a problem hiding this comment.
Should we add the date to the existing benchmarks?
Contributor
Author
It's not a bad idea, but the same can be said about all the other data types that we have converters for. I think at this point it's not as critical. Also we have #7300 that we can add these to. What do you think? |
RanVaknin
force-pushed
the
rvaknin/ddb-mapper-date-fast-path
branch
from
November 12, 2026 01:17
84f1767 to
6d682c8
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
#7518 made Joda Time optional by replacing its date formatter and parser with the JDK date/time APIs. Those APIs process dates through general purpose intermediate representations: formatting expands the timestamp into calendar objects and uses decimal arithmetic for milliseconds, while parsing builds and resolves a map of date fields before converting it back to milliseconds. These temporary objects added roughly 600 bytes per write and 830 bytes per read.
This PR keeps the general JDK implementation as the compatibility fallback and adds a fast paths for the representation normally written by the mapper.
PUT: The mapper receives aDate, so it controls the stored representation. Dates with four digit years are written directly as the fixed 24 character UTC format, such as2014-03-06T14:28:58.000Z. Dates outside that year range delegate to the the generic JDK formatter introduced in [DDB Mapper V2] Make Joda-Time an optional dependency #7518GET: Stored strings may have been written by another application. The mapper first performs a cheap length and separator check. Strings matching the fixed 24 character format are parsed directly. Strings using another supported representation, such as numeric offsets, variable fractional digits, or non padded fields delegate to the generic JDK parser added in [DDB Mapper V2] Make Joda-Time an optional dependency #7518Benchmarks
Targeted JMH benchmark on c6g.metal, Corretto 17.0.20, with 3 warmups, 3 measurements, 2 forks, and -prof gc.
I reused
EnhancedClientGetV1MapperComparisonBenchmarkandEnhancedClientPutV1MapperComparisonBenchmarkthat have been used for mapper testing, but seeded if with date fields so that they can exercise the new codepath. limited to SMALL and HUGE payloads:Results