Skip to main content

count_words_parallel

Function count_words_parallel 

Source
pub fn count_words_parallel(data: &[u8]) -> u64
Expand description

Count words in parallel with boundary adjustment.

Each chunk is counted independently, then boundaries are checked: if chunk N ends with non-whitespace and chunk N+1 starts with non-whitespace, a word was split across the boundary and double-counted — subtract 1.