Repository navigation
Conversation
FrankChen021
left a comment
There was a problem hiding this comment.
🟢 Approval recommended
The timestamp fast paths preserve the inspected canonical, fallback, boundary, invalid-input, and segment-delimiter behavior. The whitespace-only line is non-blocking and does not affect runtime behavior.
Reviewed 6 of 6 changed files; finding in 1 file.
Validation: scoped git diff --check reported trailing whitespace at DateTimes.java:208; no tests or builds were run.
| Severity | Findings |
|---|---|
| P0 | 0 |
| P1 | 0 |
| P2 | 0 |
| P3 | 1 |
| Total | 1 |
This is an automated review by Codex GPT-5.6-Luna(max)
After addressing the findings or replying to the comments, you can request another review from me to trigger a new automated review.
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
[P3] Remove trailing whitespace
Finding: The added blank line contains spaces, so scoped git diff --check reports trailing whitespace at this line.
Suggestion: Remove the spaces from the blank line.
|
hi, could I get another review now? |
FrankChen021
left a comment
There was a problem hiding this comment.
🟢 Approval recommended
The current head is ready to merge. The timestamp fast paths retain existing fallback behavior, and the SegmentId delimiter rewrite preserves the prior version/partition parsing semantics. The prior whitespace-only finding is resolved.
Reviewed 6 of 6 changed files. The incremental diff was checked first, followed by the complete current merge-base diff and relevant surrounding code.
Validation: git diff --check passed. Narrow Joda and Guava checks confirmed representative parser and delimiter behavior; no Maven tests or builds were run.
This is an automated review by Codex GPT-5.6-Luna(max)
Related to #20927 (scoped by the maintainer to
SegmentId.tryParseandDateTimes.ofviaSegmentRecord.fromResultSet). This does not fully resolve that issue.Description
Draft PR for the two method-level optimizations suggested on #20927. One shows a small measurable gain and the other does not, so I'd like guidance before taking it further. Behavior, config, metrics and wire formats are unchanged.
DateTimes.of(String)fast pathAdded a fast path for the canonical 24-character
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'form. Anything else (null, no millis, non-Zoffset, date-only, epoch millis, out-of-range fields, non-digit characters) falls through to the existing logic unchanged.SegmentId.iteratePossibleParsingsWithDataSourceDateTimes.ISO_DATE_TIME.Splitter/Joinerreplaced withindexOf/lastIndexOfextraction (iterateAllPossibleParsingsstill uses them).Tests and benchmarks
Unit tests for boundary values and fallback paths, plus two JMH benchmarks (
DateTimesOfBenchmark,SegmentIdParseBenchmark) that compare against a frozen copy of the old implementation in the same run.Benchmark results
JMH 1.37, JDK 27, Windows laptop, 3 forks x (5x1s warmup + 10x1s measurement). Each op parses 1000 inputs.
DateTimes.of(measured before I inlined the digit helpers into one method; a re-run on the current code is pending):That is roughly 3-5% faster, and the fallback paths are not slower.
SegmentId.tryParse(latest run, with both the fast path andindexOfsplitting):This is about 3% faster, level, and about 6% slower, with overlapping or barely separated intervals. I don't consider it a demonstrated speedup.
Issues encountered
SegmentIdfast path that used small helper methods was 4-16% slower. Inlining it into one method did not fix that.indexOfsplitting only moved the numbers slightly.current, but the frozen legacy baseline was ~40% slower than in every other run. I treated that as machine noise and discarded it.Interval/SegmentIdobjects rather than parsing, so it may understate the gain on the Coordinator sync path. I have not verified this.Questions for reviewers
SegmentRecordconstruction) that I should use?DateTimes.ofchange, keep both since behavior is identical, or drop this?Release note
None for now. This is a CPU-only change with no user-visible behavior. I'll revisit if it becomes mergeable.
Key changed/added classes in this PR
DateTimesSegmentIdDateTimesOfBenchmarkSegmentIdParseBenchmarkThis PR has: