Hi list,
as exim is reading the spool-files pretty often I started to browse
through the code of spool_in.c on the hunt for places to optimize it a
bit. I've found the "option-reading" code to be rather "direct" in it's
approach, so I've changed it to check the first letter via a switch/case
statement and reordered the code a bit to fit the scheme. On my system
this brings down the string compares in this section for a usual message
from 80-100 to 12-15. The patch is rather big, but it doesn't change much.
While looking in there, I was wondering why some compares use Ustrncmp,
and others Ustrcmp. Backward-compatibility issues? As I wasn't sure
about the reasons I've added tolower to the switch-statement.
Nico
P.S. As this is a rather sensitive part of the code, please check the
patch before commiting it. I'll be away for the rest of the week, so I
won't be able to fix my errors this time. :)
as exim is reading the spool-files pretty often I started to browse
through the code of spool_in.c on the hunt for places to optimize it a
bit. I've found the "option-reading" code to be rather "direct" in it's
approach, so I've changed it to check the first letter via a switch/case
statement and reordered the code a bit to fit the scheme. On my system
this brings down the string compares in this section for a usual message
from 80-100 to 12-15. The patch is rather big, but it doesn't change much.
While looking in there, I was wondering why some compares use Ustrncmp,
and others Ustrcmp. Backward-compatibility issues? As I wasn't sure
about the reasons I've added tolower to the switch-statement.
Nico
P.S. As this is a rather sensitive part of the code, please check the
patch before commiting it. I'll be away for the rest of the week, so I
won't be able to fix my errors this time. :)