[PATCH] ext/imap (imap_search)
| From: | Rob Siemborski | Date: | Thu, 16 Aug 2001 19:43:23 +0000 |
| Subject: | [PATCH] ext/imap (imap_search) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-63467@lists.php.net to get a copy of this message | ||
I've been doing some work with large mailboxes using the php imap module
and I uncovered a pretty severe efficiency bug that results in monstrous
amounts of silly computation.
Basically, what is happening is each call to mm_searched() is resulting in
a traversal of the entire linked list so far. I believe this results in
something like O(nlog(n)) performance on what should be an O(1) operation.
The addition of a tail pointer to the list fixes this problem. I also
made the free function non-recursive, which is somthing that could
probabally be applied to most of the list-freeing functions in php_imap.c
I'd like to see this in 4.0.7 if possible.
Please give comments / let me know when its committed.
Thanks,
-Rob
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Rob Siemborski | W3VC President * Scotch & Soda Technical Coordinator
Andrew Systems Group * Cyert Hall 235 * 412-CMU-TREK | ABTech Exec
-----BEGIN GEEK CODE BLOCK----
Version: 3.12
GCS/IT/CM/CC/PA d- s+: a-- C++++$ UBLS++++$ P+++$ L++(+++) E W- N- o?
K- w O- M-- V-- PS+ PE++ Y+ PGP+ t+@ 5+++ R@ tv-- b+ DI+++ G e h r y?
------END GEEK CODE BLOCK-----