[OPTIM] move some rarely used fields out of fdtab
Some rarely information are stored in fdtab, making it larger for no
reason (source port ranges, remote address, ...). Such information
lie there because the checks can't find them anywhere else. The goal
will be to move these information to the stream interface once the
checks make use of it.
For now, we move them to an fdinfo array. This simple change might
have improved the cache hit ratio a little bit because a 0.5% of
performance increase has measured.
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index 4fceadc..186ddda 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -267,8 +267,8 @@
fdtab[fd].cb[DIR_RD].b = fdtab[fd].cb[DIR_WR].b = NULL;
fdtab[fd].owner = listener; /* reference the listener instead of a task */
fdtab[fd].state = FD_STLISTEN;
- fdtab[fd].peeraddr = NULL;
- fdtab[fd].peerlen = 0;
+ fdinfo[fd].peeraddr = NULL;
+ fdinfo[fd].peerlen = 0;
return ERR_NONE;
}
@@ -537,8 +537,8 @@
fdtab[cfd].cb[DIR_RD].b = s->req;
fdtab[cfd].cb[DIR_WR].f = l->proto->write;
fdtab[cfd].cb[DIR_WR].b = s->rep;
- fdtab[cfd].peeraddr = (struct sockaddr *)&s->cli_addr;
- fdtab[cfd].peerlen = sizeof(s->cli_addr);
+ fdinfo[cfd].peeraddr = (struct sockaddr *)&s->cli_addr;
+ fdinfo[cfd].peerlen = sizeof(s->cli_addr);
EV_FD_SET(cfd, DIR_RD);