Skip to content

add a util method to sanity check time size instead of using regex#8943

Closed
klsince wants to merge 1 commit intoapache:masterfrom
klsince:refine_time_size_sanity_check
Closed

add a util method to sanity check time size instead of using regex#8943
klsince wants to merge 1 commit intoapache:masterfrom
klsince:refine_time_size_sanity_check

Conversation

@klsince
Copy link
Contributor

@klsince klsince commented Jun 21, 2022

This PR adds a util method to replace the regex matches based sanity check on time size in date time spec. The regex matches can be very costly when converting date time values for segment generation.

@klsince
Copy link
Contributor Author

klsince commented Jun 21, 2022

image

Benchmark                                       (_totalCount)  Mode  Cnt      Score       Error  Units
BenchmarkTimeSizeCheck.useCompiledPattern              100000  avgt    5   7304.817 ±  1574.564  us/op
BenchmarkTimeSizeCheck.useCompiledPattern:·jfr         100000  avgt             NaN                ---
BenchmarkTimeSizeCheck.useRegexString                  100000  avgt    5  24047.471 ± 12731.113  us/op
BenchmarkTimeSizeCheck.useRegexString:·jfr             100000  avgt             NaN                ---
BenchmarkTimeSizeCheck.useUtilMethod                   100000  avgt    5   2493.348 ±  1181.530  us/op
BenchmarkTimeSizeCheck.useUtilMethod:·jfr              100000  avgt             NaN                ---

@klsince
Copy link
Contributor Author

klsince commented Jun 21, 2022

this PR seems not necessary with: #8939

@klsince klsince closed this Jun 21, 2022
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