Auteur: Philip Hazel Date: À: Nico Erfurth CC: exim-dev Sujet: Re: [exim-dev] Speeding up spool_in.c a bit
On Mon, 25 Sep 2006, Nico Erfurth wrote:
> 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.
I have now put on this patch, modified just a bit. (I found only one
bug: you had the "if" of an if-else set within an "#ifdef
WITH_CONTENT_SCAN" so it would have broken on a non-content-scanning
compile.) I decided that, since we were optimizing here, it might also
be worth not rescanning the first two characters of each name, so I've
changed the string compares to start at the third character. I also put
everything into the individual switch cases; it seemed untidy without.
This code is now committed, and will be in tonight's snapshot. It passes
all my tests, so it can't be *very* broken. :-)
Philip
--
Philip Hazel, University of Cambridge Computing Service.