mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-21 22:45:34 +00:00
DIET/MINOR: task: reduce struct task size by 8 bytes
Just by reordering the struct task, we could shrink it by 8 bytes from 120 to 112 bytes. A careful reordering allowed each part to be located closer to the hot parts it's used with, resulting in another performance increase of about 0.5%.
This commit is contained in:
parent
5735d7e2a2
commit
05efc0f33a
@ -52,14 +52,14 @@
|
|||||||
|
|
||||||
/* The base for all tasks */
|
/* The base for all tasks */
|
||||||
struct task {
|
struct task {
|
||||||
struct eb32_node wq; /* ebtree node used to hold the task in the wait queue */
|
|
||||||
struct eb32_node rq; /* ebtree node used to hold the task in the run queue */
|
struct eb32_node rq; /* ebtree node used to hold the task in the run queue */
|
||||||
int state; /* task state : bit field of TASK_* */
|
unsigned short state; /* task state : bit field of TASK_* */
|
||||||
int expire; /* next expiration date for this task, in ticks */
|
short nice; /* the task's current nice value from -1024 to +1024 */
|
||||||
unsigned int calls; /* number of times ->process() was called */
|
unsigned int calls; /* number of times ->process() was called */
|
||||||
struct task * (*process)(struct task *t); /* the function which processes the task */
|
struct task * (*process)(struct task *t); /* the function which processes the task */
|
||||||
void *context; /* the task's context */
|
void *context; /* the task's context */
|
||||||
int nice; /* the task's current nice value from -1024 to +1024 */
|
struct eb32_node wq; /* ebtree node used to hold the task in the wait queue */
|
||||||
|
int expire; /* next expiration date for this task, in ticks */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user