From: Willy Tarreau Date: Sat, 13 Oct 2012 09:22:24 +0000 (+0200) Subject: OPTIM: session: reorder struct session fields X-Git-Tag: v1.5-dev13~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=109e95a1b4e2d21c111eda6d68c818430bff924c;p=thirdparty%2Fhaproxy.git OPTIM: session: reorder struct session fields A reorering of the struct session fields has increased overall performance by almost 1% due to better cache usage. --- diff --git a/include/types/session.h b/include/types/session.h index 54f0551c80..e3ccde8ed7 100644 --- a/include/types/session.h +++ b/include/types/session.h @@ -104,23 +104,26 @@ * server should eventually be released. */ struct session { - struct list list; /* position in global sessions list */ - struct list by_srv; /* position in server session list */ - struct list back_refs; /* list of users tracking this session */ - struct task *task; /* the task associated with this session */ - /* application specific below */ - struct listener *listener; /* the listener by which the request arrived */ - struct proxy *fe; /* the proxy this session depends on for the client side */ - struct proxy *be; /* the proxy this session depends on for the server side */ int flags; /* some flags describing the session */ + struct target target; /* target to use for this session */ + struct channel *req; /* request buffer */ struct channel *rep; /* response buffer */ - struct stream_interface si[2]; /* client and server stream interfaces */ + + struct proxy *fe; /* the proxy this session depends on for the client side */ + struct proxy *be; /* the proxy this session depends on for the server side */ + + struct listener *listener; /* the listener by which the request arrived */ struct server *srv_conn; /* session already has a slot on a server and is not in queue */ - struct target target; /* target to use for this session */ struct pendconn *pend_pos; /* if not NULL, points to the position in the pending queue */ + struct http_txn txn; /* current HTTP transaction being processed. Should become a list. */ + struct task *task; /* the task associated with this session */ + struct list list; /* position in global sessions list */ + struct list by_srv; /* position in server session list */ + struct list back_refs; /* list of users tracking this session */ + struct { struct stksess *ts; struct stktable *table; @@ -133,6 +136,7 @@ struct session { struct stksess *stkctr2_entry; /* entry containing counters currently being tracked as set 2 by this session */ struct stktable *stkctr2_table; /* table the counters above belong to (undefined if counters are null) */ + struct stream_interface si[2]; /* client and server stream interfaces */ struct { int logwait; /* log fields waiting to be collected : LW_* */ struct timeval accept_date; /* date of the accept() in user date */