]> git.ipfire.org Git - thirdparty/squid.git/commit
Optimize appending to empty SBufs, a common use case.
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 3 Nov 2016 13:57:02 +0000 (02:57 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 3 Nov 2016 13:57:02 +0000 (02:57 +1300)
commita7378e715141a56527221d8212901c35c8360a95
tree32049dec3df0e3be9608aab18e5ca1aaf94fadbf
parent37ef8293592125608d704e4de5e8cdc5879f914d
Optimize appending to empty SBufs, a common use case.

Most appends start with an empty buffer. Some append only once. There
is no reason to allocate new memory for that first append or force the
appender to write code to optimize that first append.

Why also check that SBuf has never been configured or altered then? To
preserve pre-allocated SBufs, such as those [ab]used as I/O buffers.
src/sbuf/SBuf.cc