Skip to content
Snippets Groups Projects
user avatar
Glauber Costa authored
While running one of the redis benchmarks, I saw around 23k calls to
malloc_large.  Among those, ~10 - 11k were 2-page sized. I managed to track it
down to the creation of net channels. The problem here is that the net channel
structure is slightly larger than half a page - the maximum size for small
object pools. That will throw all allocations into malloc_large. Besides being
slow, it also wastes a page for every net channel created, since malloc_large
will include an extra page in the beginning of each allocation.

This patch fixes this by overloading the operators new and delete for the
netchannel structure so that we use the more efficient and less wasteful
alloc_page.

Reviewed-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
8e087635
History
Name Last commit Last update
..