GWphua commented on code in PR #18477:
URL: https://github.com/apache/druid/pull/18477#discussion_r2321391094
##########
processing/src/main/java/org/apache/druid/java/util/common/Intervals.java:
##########
@@ -53,6 +57,46 @@ public static Interval of(String format, Object...
formatArgs)
return of(StringUtils.format(format, formatArgs));
}
+ /**
+ * @return Null if cannot parse with optimized strategy, else return the
Interval.
Review Comment:
Hi @kfaraz an update on `canDeserializeOptimally()`, I added a check to see
if the interval contains a `Period`, and conduct a fail-fast. The results look
much better.
```
Benchmark
(numValues) Mode Cnt Score Error Units
JodaIntervalDeserializationBenchmark.deserializeLegacy
20000 avgt 5 21.115 ± 0.302 ms/op
JodaIntervalDeserializationBenchmark.deserializeLegacyFallback
20000 avgt 5 13.831 ± 0.373 ms/op
JodaIntervalDeserializationBenchmark.deserializeOptimized
20000 avgt 5 11.909 ± 0.343 ms/op
JodaIntervalDeserializationBenchmark.deserializeOptimizedFallback
20000 avgt 5 14.014 ± 0.477 ms/op
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]