]> git.ipfire.org Git - thirdparty/squid.git/commit
Optimization: Fewer memory (re)allocations for HTTP headers (#239) M-staged-PR239
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Fri, 13 Jul 2018 21:27:19 +0000 (21:27 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 14 Jul 2018 17:33:11 +0000 (17:33 +0000)
commitc3b51d64909335642672ca01dc6da9526187d36d
tree195616d265f4d28838b768845db25c21f3d4bed4
parent1c8fc2a269c1b2eaed1dc6a43dde1e2e66cca182
Optimization: Fewer memory (re)allocations for HTTP headers (#239)

Tests revealed multiple fresh memory allocations/deallocations while
storing small (few fields) HTTP headers. Many popular sites use larger
headers (15-30 fields). To avoid expensive memory operations:

1. Pool all std::vector<HttpHeaderEntries*> memory allocations.
2. Prevent reallocations (for HTTP headers with fewer than 32 fields).

This optimization deals with storing the header index. It does not
affect how individual header fields are stored.
src/HttpHeader.cc
src/HttpHeader.h
src/mem/Makefile.am
src/mem/PoolingAllocator.h [new file with mode: 0644]
src/mem/forward.h
src/mem/old_api.cc
src/tests/stub_libmem.cc