[Dovecot] Dovecot - some more optimisations

Len7hir len7hir at gmail.com
Wed Sep 1 14:23:31 EEST 2010


I did some more optimisation.


Most performance hit in Dovecot do "for loop" in string operations.

In one case (in message-parser.c) "for loop" has another "for" inside 
with the same variable used as iterator. This case is very hard to 
optimise by compiler.

I do changes only in top functions listed in oprofile.
Maybe I do more in future.


Code was analysed and tested but it's hard to generate all cases.
It's working well in production server (I'm monitoring).


In istream-crlf.c I've changed one thing.
When destination buffer is full after '\r' addition (to dest), It didn't 
skip '\n' in source buffer. I think this was buggy in earlier code, and 
'\n' was skipped (this piece of code is used very rare).


Please check this out. This can help in huge e-mail systems :P


And another problem. Why You use safe_memset instead of memset?
Now this function have the largest impact in Dovecot performance.
Another on list is t_push.


Regards,
Len7hir
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dovecot-patch1.diff
Url: http://dovecot.org/pipermail/dovecot/attachments/20100901/207bdd8c/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dovecot-patch2.diff
Url: http://dovecot.org/pipermail/dovecot/attachments/20100901/207bdd8c/attachment-0001.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dovecot-patch3.diff
Url: http://dovecot.org/pipermail/dovecot/attachments/20100901/207bdd8c/attachment-0002.pl 


More information about the dovecot mailing list