Closed andrewauclair closed 5 days ago
@andrewauclair Do you have any performance measurements with these changes compared to 1.13?
@andrewauclair Do you have any performance measurements with these changes compared to 1.13?
Came up with the following when running in WSL with the code from issue #4592:
1.12.5: 0m0.063s 1.13.3: 0m11.991s (almost 200x slower?) this pr: 0m0.185s (3x slower, likely the regex match)
Switching to a format string that doesn't match one of the expected ones, to avoid regex matches (const auto format = Poco::DateTimeFormat::ISO8601_FRAC_FORMAT + " "
):
1.12.5: 0m0.063s 1.13.3: 0m0.065s this pr: 0m0.085s
Improvements for #4592.
Improve the validation of
DateTimeParser
by validating the numbers parsed forday
,month
,year
,hour
,minute
,second
,millis
, andmicros
. The value 0 will be used if no digits were found formicros
.These changes create new instances of
SyntaxException
thrown byDateTimeParser::parse
andDateTimeParser::parseTZD
when the previously listed fields do not contain the required number of digits or the string of digits is not a valid number.Improve performance by caching the
RegularExpression
s created inDateTimeFormat::isValid
.