CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2021/11/01 17:20:35

Modified files:
        usr.bin/uniq   : uniq.c 

Log message:
uniq(1): support arbitrarily long input lines

Switch from fgets(3) to getline(3) to support input lines of any
length.

Tested by sthen@, who uncovered a dumb bug that cut throughput in
half.  getline(3) is indeed slower than fgets(3), but not *twice* as
slow.

millert@ suggests that preallocating both line buffers might be
worthwhile.  I will need to do some additional testing to figure out
whether 8KB buffers (like we had for fgets(3)) are appropriate
starting lengths.  For now I am not preallocating either buffer.

ok millert@ sthen@

Reply via email to