CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]    2026/11/27 12:38:32

Modified files:
        usr.bin/ssh    : sshbuf.c sshbuf.h 

Log message:
Some performance improvements for sshbuf

1. When allocating, geometrically scale the buffer by 1.25x rather
than doing linear increments. This avoids quadratic behaviour in
some cases and expensive ramp up if the target state is a large
buffer.
2. Keep a 50% allocation headroom above the requested maximum size.
Because we need to sometime repack buffers by memmove()ing their
contents from the end of the buffer to the start, this avoids a
pathological state where an almost-full buffer that is doing
small get/put operations spends almost all of its time in memcpy.

ok markus@

Reply via email to