Re: wc(1): accelerate word counting

2022-08-03 Thread Scott Cheloha
On Wed, Nov 17, 2021 at 08:37:53AM -0600, Scott Cheloha wrote: > In wc(1) we currently count words, both ASCII and multibyte, in a > getline(3) loop. > > This makes sense in the multibyte case because stdio handles all the > nasty buffer resizing for us. We avoid splitting a multibyte between > t

wc(1): accelerate word counting

2021-11-17 Thread Scott Cheloha
In wc(1) we currently count words, both ASCII and multibyte, in a getline(3) loop. This makes sense in the multibyte case because stdio handles all the nasty buffer resizing for us. We avoid splitting a multibyte between two read(2) calls and the resulting code is simpler. However, for ASCII inp