Avatar for the uutils user
uutils
coreutils
BlogDocsChangelog

uucore: parse_time: avoid expensive `with_scale(9)` for huge inputs

#8740Merged
Comparing
loskutov:patch-1
(
3d727ca
) with
main
(
7dbeb8f
)
CodSpeed Performance Gauge
0%
Untouched
55
Skipped
1

Benchmarks

Skipped (1)

Passed

numfmt_padding[(1000000, 50)]
src/uu/numfmt/benches/numfmt_bench.rs::numfmt_padding[(1000000, 50)]
CodSpeed Performance Gauge
0%
213.6 µs213.2 µs
numfmt_round_modes[("down", 1000000)]
src/uu/numfmt/benches/numfmt_bench.rs::numfmt_round_modes[("down", 1000000)]
CodSpeed Performance Gauge
0%
212.1 µs211.8 µs
numfmt_round_modes[("towards-zero", 1000000)]
src/uu/numfmt/benches/numfmt_bench.rs::numfmt_round_modes[("towards-zero", 1000000)]
CodSpeed Performance Gauge
0%
211.4 µs211.2 µs
numfmt_large_numbers_si[1000000]
src/uu/numfmt/benches/numfmt_bench.rs::numfmt_large_numbers_si[1000000]
CodSpeed Performance Gauge
0%
211.7 µs211.5 µs
tsort_complex_dag[10000]
src/uu/tsort/benches/tsort_bench.rs::tsort_complex_dag[10000]
CodSpeed Performance Gauge
0%
155.7 µs155.6 µs
numfmt_to_iec[1000000]
src/uu/numfmt/benches/numfmt_bench.rs::numfmt_to_iec[1000000]
CodSpeed Performance Gauge
0%
210.7 µs210.5 µs
numfmt_from_si[1000000]
src/uu/numfmt/benches/numfmt_bench.rs::numfmt_from_si[1000000]
CodSpeed Performance Gauge
0%
210.4 µs210.2 µs
numfmt_to_si[1000000]
src/uu/numfmt/benches/numfmt_bench.rs::numfmt_to_si[1000000]
CodSpeed Performance Gauge
0%
211.1 µs211 µs
numfmt_padding[(1000000, 5)]
src/uu/numfmt/benches/numfmt_bench.rs::numfmt_padding[(1000000, 5)]
CodSpeed Performance Gauge
0%
213.4 µs213.3 µs
numfmt_to_si_precision[1000000]
src/uu/numfmt/benches/numfmt_bench.rs::numfmt_to_si_precision[1000000]
CodSpeed Performance Gauge
0%
216.9 µs216.8 µs
tsort_tree_dag[(6, 2)]
src/uu/tsort/benches/tsort_bench.rs::tsort_tree_dag[(6, 2)]
CodSpeed Performance Gauge
0%
155.4 µs155.3 µs
tsort_linear_chain[100000]
src/uu/tsort/benches/tsort_bench.rs::tsort_linear_chain[100000]
CodSpeed Performance Gauge
0%
155.2 µs155.2 µs
tsort_wide_dag[10000]
src/uu/tsort/benches/tsort_bench.rs::tsort_wide_dag[10000]
CodSpeed Performance Gauge
0%
155.1 µs155 µs
tsort_input_parsing_heavy[10000]
src/uu/tsort/benches/tsort_bench.rs::tsort_input_parsing_heavy[10000]
CodSpeed Performance Gauge
0%
148.6 µs148.6 µs
numfmt_round_modes[("up", 100000)]
src/uu/numfmt/benches/numfmt_bench.rs::numfmt_round_modes[("up", 100000)]
CodSpeed Performance Gauge
0%
211.4 µs211.4 µs
wc_lines_large_line_count[10000]
src/uu/wc/benches/wc_bench.rs::wc_lines_large_line_count[10000]
CodSpeed Performance Gauge
0%
5.1 ms5.1 ms
wc_chars_large_line_count[10000]
src/uu/wc/benches/wc_bench.rs::wc_chars_large_line_count[10000]
CodSpeed Performance Gauge
0%
5.1 ms5.1 ms
wc_words_large_line_count[10000]
src/uu/wc/benches/wc_bench.rs::wc_words_large_line_count[10000]
CodSpeed Performance Gauge
0%
5.1 ms5.1 ms
wc_default_large_line_count[10000]
src/uu/wc/benches/wc_bench.rs::wc_default_large_line_count[10000]
CodSpeed Performance Gauge
0%
5.1 ms5.1 ms
tsort_complex_dag[50000]
src/uu/tsort/benches/tsort_bench.rs::tsort_complex_dag[50000]
CodSpeed Performance Gauge
0%
155.2 µs155.2 µs
wc_default_large_line_count[50000]
src/uu/wc/benches/wc_bench.rs::wc_default_large_line_count[50000]
CodSpeed Performance Gauge
0%
24.6 ms24.6 ms
wc_lines_extreme_line_lengths[(100000, 10)]
src/uu/wc/benches/wc_bench.rs::wc_lines_extreme_line_lengths[(100000, 10)]
CodSpeed Performance Gauge
0%
9.2 ms9.2 ms
wc_lines_variable_length[(5, 50)]
src/uu/wc/benches/wc_bench.rs::wc_lines_variable_length[(5, 50)]
CodSpeed Performance Gauge
0%
28.9 ms28.9 ms
wc_lines_variable_length[(5, 200)]
src/uu/wc/benches/wc_bench.rs::wc_lines_variable_length[(5, 200)]
CodSpeed Performance Gauge
0%
28.8 ms28.8 ms
wc_lines_large_line_count[50000]
src/uu/wc/benches/wc_bench.rs::wc_lines_large_line_count[50000]
CodSpeed Performance Gauge
0%
24.6 ms24.6 ms
wc_words_synthetic[10]
src/uu/wc/benches/wc_bench.rs::wc_words_synthetic[10]
CodSpeed Performance Gauge
0%
57.5 ms57.5 ms
wc_lines_variable_length[(5, 100)]
src/uu/wc/benches/wc_bench.rs::wc_lines_variable_length[(5, 100)]
CodSpeed Performance Gauge
0%
28.8 ms28.8 ms
wc_words_large_line_count[50000]
src/uu/wc/benches/wc_bench.rs::wc_words_large_line_count[50000]
CodSpeed Performance Gauge
0%
24.6 ms24.6 ms
wc_bytes_lines_synthetic[10]
src/uu/wc/benches/wc_bench.rs::wc_bytes_lines_synthetic[10]
CodSpeed Performance Gauge
0%
57.5 ms57.5 ms
wc_lines_variable_length[(5, 500)]
src/uu/wc/benches/wc_bench.rs::wc_lines_variable_length[(5, 500)]
CodSpeed Performance Gauge
0%
28.7 ms28.7 ms
wc_chars_large_line_count[50000]
src/uu/wc/benches/wc_bench.rs::wc_chars_large_line_count[50000]
CodSpeed Performance Gauge
0%
24.6 ms24.6 ms
wc_words_large_line_count[100000]
src/uu/wc/benches/wc_bench.rs::wc_words_large_line_count[100000]
CodSpeed Performance Gauge
0%
48.9 ms48.9 ms
wc_default_large_line_count[100000]
src/uu/wc/benches/wc_bench.rs::wc_default_large_line_count[100000]
CodSpeed Performance Gauge
0%
48.9 ms48.9 ms
wc_lines_large_line_count[100000]
src/uu/wc/benches/wc_bench.rs::wc_lines_large_line_count[100000]
CodSpeed Performance Gauge
0%
48.9 ms48.9 ms
wc_bytes_synthetic[10]
src/uu/wc/benches/wc_bench.rs::wc_bytes_synthetic[10]
CodSpeed Performance Gauge
0%
57.5 ms57.5 ms
wc_lines_extreme_line_lengths[(100000, 200)]
src/uu/wc/benches/wc_bench.rs::wc_lines_extreme_line_lengths[(100000, 200)]
CodSpeed Performance Gauge
0%
117.2 ms117.2 ms
wc_chars_large_line_count[100000]
src/uu/wc/benches/wc_bench.rs::wc_chars_large_line_count[100000]
CodSpeed Performance Gauge
0%
48.9 ms48.9 ms
wc_words_synthetic[100]
src/uu/wc/benches/wc_bench.rs::wc_words_synthetic[100]
CodSpeed Performance Gauge
0%
573.4 ms573.4 ms
wc_bytes_synthetic[50]
src/uu/wc/benches/wc_bench.rs::wc_bytes_synthetic[50]
CodSpeed Performance Gauge
0%
286.8 ms286.8 ms
wc_bytes_synthetic[100]
src/uu/wc/benches/wc_bench.rs::wc_bytes_synthetic[100]
CodSpeed Performance Gauge
0%
573.4 ms573.4 ms
wc_lines_large_line_count[500000]
src/uu/wc/benches/wc_bench.rs::wc_lines_large_line_count[500000]
CodSpeed Performance Gauge
0%
244 ms244 ms
wc_bytes_lines_synthetic[1000]
src/uu/wc/benches/wc_bench.rs::wc_bytes_lines_synthetic[1000]
CodSpeed Performance Gauge
0%
5.7 s5.7 s
wc_words_synthetic[1000]
src/uu/wc/benches/wc_bench.rs::wc_words_synthetic[1000]
CodSpeed Performance Gauge
0%
5.7 s5.7 s
wc_bytes_lines_synthetic[100]
src/uu/wc/benches/wc_bench.rs::wc_bytes_lines_synthetic[100]
CodSpeed Performance Gauge
0%
573.4 ms573.4 ms
tsort_input_parsing_heavy[50000]
src/uu/tsort/benches/tsort_bench.rs::tsort_input_parsing_heavy[50000]
CodSpeed Performance Gauge
0%
154.7 µs154.7 µs
tsort_wide_dag[100000]
src/uu/tsort/benches/tsort_bench.rs::tsort_wide_dag[100000]
CodSpeed Performance Gauge
0%
154.9 µs155 µs
tsort_tree_dag[(5, 3)]
src/uu/tsort/benches/tsort_bench.rs::tsort_tree_dag[(5, 3)]
CodSpeed Performance Gauge
0%
155.3 µs155.4 µs
tsort_complex_dag[5000]
src/uu/tsort/benches/tsort_bench.rs::tsort_complex_dag[5000]
CodSpeed Performance Gauge
0%
155.7 µs155.7 µs
tsort_tree_dag[(4, 3)]
src/uu/tsort/benches/tsort_bench.rs::tsort_tree_dag[(4, 3)]
CodSpeed Performance Gauge
0%
155.7 µs155.8 µs
tsort_complex_dag[1000]
src/uu/tsort/benches/tsort_bench.rs::tsort_complex_dag[1000]
CodSpeed Performance Gauge
0%
155.1 µs155.2 µs
tsort_linear_chain[10000]
src/uu/tsort/benches/tsort_bench.rs::tsort_linear_chain[10000]
CodSpeed Performance Gauge
0%
156.2 µs156.3 µs
tsort_linear_chain[1000000]
src/uu/tsort/benches/tsort_bench.rs::tsort_linear_chain[1000000]
CodSpeed Performance Gauge
0%
155.5 µs155.7 µs
tsort_linear_chain[1000]
src/uu/tsort/benches/tsort_bench.rs::tsort_linear_chain[1000]
CodSpeed Performance Gauge
0%
155.1 µs155.2 µs
tsort_tree_dag[(7, 2)]
src/uu/tsort/benches/tsort_bench.rs::tsort_tree_dag[(7, 2)]
CodSpeed Performance Gauge
0%
155.5 µs155.8 µs
tsort_wide_dag[50000]
src/uu/tsort/benches/tsort_bench.rs::tsort_wide_dag[50000]
CodSpeed Performance Gauge
0%
154.8 µs155 µs

Commits

Click on a commit to change the comparison range
Base
main
7dbeb8f
0%
uucore: parse_time: avoid expensive `with_scale(9)` for huge inputs The conversion routine used to parse the time into a BigDecimal and normalize it into nanoseconds; however, for an input like 1e6666666666668320 it would require allocating a number with 6666666666668329 zeroes, which is obviously suboptimal (and redundant, as `Duration` uses `u64` for seconds). Fixes #8634.
3d727ca
1 day ago
by loskutov
© 2025 CodSpeed Technology
Home Terms Privacy Docs