DIET/MINOR: http: reduce the size of struct http_txn by 8 bytes
Here again we had some oversized and misaligned entries. The method
and the status don't need 4 bytes each, and there was a hole after
the status that does not exist anymore. That's 8 additional bytes
saved from http_txn and as much for the session.
Also some fields were slightly moved to present better memory access
patterns resulting in a steady 0.5% performance increase.
diff --git a/src/proto_http.c b/src/proto_http.c
index a06b0ec..c8705d4 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -294,7 +294,7 @@
* up to 3 entries (2 valid, 1 null).
*/
struct http_method_desc {
- http_meth_t meth;
+ enum http_meth_t meth;
int len;
const char text[8];
};
@@ -767,7 +767,7 @@
* returns HTTP_METH_NONE if there is nothing valid to read (empty or non-text
* string), HTTP_METH_OTHER for unknown methods, or the identified method.
*/
-static http_meth_t find_http_meth(const char *str, const int len)
+static enum http_meth_t find_http_meth(const char *str, const int len)
{
unsigned char m;
const struct http_method_desc *h;