coreutils/tests
Owen Anderson 735db78b3d
wc: specialize scanning loop on settings. (#3708)
* wc: specialize scanning loop on settings.

The primary computational loop in wc (iterating over all the
characters and computing word lengths, etc) is configured by a
number of boolean options that control the text-scanning behavior.
If we monomorphize the code loop for each possible combination of
scanning configurations, the rustc is able to generate better code
for each instantiation, at the least by removing the conditional
checks on each iteration, and possibly by allowing things like
vectorization.

On my computer (aarch64/macos), I am seeing at least a 5% performance
improvement in release builds on all wc flag configurations
(other than those that were already specialized) against
odyssey1024.txt, with wc -l showing the greatest improvement at 15%.

* Reduce the size of the wc dispatch table by half.

By extracting the handling of hand-written fast-paths to the
same dispatch as the automatic specializations, we can avoid
needing to pass `show_bytes` as a const generic to
`word_count_from_reader_specialized`. Eliminating this parameter
halves the number of arms in the dispatch.
2022-07-18 12:16:52 +02:00
..
benches/factor all: remove explicit imports of TryFrom and TryInto 2022-04-05 10:39:31 +02:00
by-util wc: specialize scanning loop on settings. (#3708) 2022-07-18 12:16:52 +02:00
common Merge pull request #3692 from jfinkels/cp-preserve-perm-link 2022-07-11 22:50:24 +02:00
fixtures comm: use NUL if delimiter is empty 2022-07-06 13:50:23 +02:00
test_util_name.rs tests: silence clippy warnings for unused_imports 2021-10-10 00:52:18 +02:00
tests.rs Replace lazy_static with once_cell 2022-07-12 14:08:30 +01:00