From: Willy Tarreau Date: Sun, 26 Nov 2017 07:54:31 +0000 (+0100) Subject: CLEANUP: cache: more efficiently pack the struct cache X-Git-Tag: v1.8.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd5efb59364056e23b0dd9bded47b0a6c523b90d;p=thirdparty%2Fhaproxy.git CLEANUP: cache: more efficiently pack the struct cache By having the cache id on 33 bytes as the first member, it was creating a hole and forcing the "hot" remaining part to be split across two cache lines. Let's move the id at the end as it's used only during config parsing. --- diff --git a/src/cache.c b/src/cache.c index 3b19f859e9..06d7ce8813 100644 --- a/src/cache.c +++ b/src/cache.c @@ -45,11 +45,11 @@ struct applet http_cache_applet; struct flt_ops cache_ops; struct cache { - char id[33]; /* cache name */ - unsigned int maxage; /* max-age */ - unsigned int maxblocks; - struct list list; /* cache linked list */ + struct list list; /* cache linked list */ struct eb_root entries; /* head of cache entries based on keys */ + unsigned int maxage; /* max-age */ + unsigned int maxblocks; + char id[33]; /* cache name */ }; /*