Feature #1355
reduce sizeof(connection) from 736 to 708 (on IA-32)
| Status: | New | Start: | ||
| Priority: | Low | Due date: | ||
| Assigned to: | jan | % Done: | 0% |
|
| Category: | core | |||
| Target version: | 1.5.0 | |||
| Pending: | No |
Resolution: | ||
Description
reduce sizeof(connection) from 736 to 708 (on IA-32)
History
09/11/2007 03:38 PM - ralf
Why?
I dont think that there is real need to save this few bytes.
Iam not sure, but does the use of bit maskes "stresses" the cpu a bit more then use just some integers?
09/11/2007 04:11 PM - Safari
Setting bit to 1 or 0 needs only one assembly instruction (on IA-32): orb or andb.
09/11/2007 06:16 PM - ralf
Hi safari,
can i contact you by mail or so?
i've some questions about this and i think its not really lighttpd related.
09/11/2007 07:00 PM - ralf
Replying to Safari:
Well, what do you have in mind?
Ok.
I play a bit, with 32bit on linux,
and the bitmask function seams to have more uhm "function calls"?
Therefore i think (i know nearly nothing about asm) this ends in more cpu coast.
09/11/2007 07:24 PM - Safari
It kind of depends what you do which is faster, but with int you have to write the variables individually (one instruction per write)
whereas with bit fields you can test/set/clear up to 32 or 64 (or 128 if SSE*) bits at a time.
http://safari.iki.fi/testbits/testbits.c
http://safari.iki.fi/testbits/testbits.s
Which one is better now? =)
09/11/2007 07:37 PM - ralf
Ok, but this test says its faster if you ask for (nearly) all variables.
But in a real world program (lighttpd) this is never happen.
I grep a bit around "{{{ grep -- '->file_started' *.c }}}" and there is (mostly?) only one ask for a part of the bitmask.
However, i think the price of this is immeasurable - but havent benchmarked it.