note 41540 deleted from function.imap-headers by didou
| From: | didou@php.net | Date: | Sun, 14 Jan 2007 23:40:20 +0000 |
| Subject: | note 41540 deleted from function.imap-headers by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121668@lists.php.net to get a copy of this message | ||
Note Submitter: consult at pmkmedia dot com
----
RE: jemore at n0spam dot m6net dot fr (13-Nov-2003 11:17)
A fallacious assertion, to be sure.
PMK Media ran an indicative test with a POP3 server and script on separate physical servers and
indeed physical locations - the script in California and the mail server in Virginia (at least,
presumably closer to the East Coast - Sprint Earthlink DSL).
The test code:
<?
// connect to pop3 server first, then:
$time = microtime();
$headers = imap_headers($mbox);
$timediff = microtime() - $time;
echo "Time taken: ".$timediff;
// disconnect...
?>
The page was refreshed several times to obtain average data.
With 2 small messages (total 4367 characters, 2 messages on the server):
Time taken: 0.12 (max, first run)
Time taken: 0.08 (average)
After sending a 2.8 megabyte attachment (total 3947423 characters, 3 messages on the server):
Time taken: 0.16 (max, first run)
Time taken: 0.11 (average)
The increase in execution time was 0.02 seconds. This would indicate a transfer rate of about 150 MB
per second had attachments indeed been fetched.
A test on the theory that message bodies are downloaded was also conducted. Ten large messages were
sent (200K each, 211590 characters) and the script above was executed after the first message and
again after all ten. No messages were deleted during the course of the test:
After sending one 200K message (total 4159013 characters, 4 messages on the server):
Time taken: 0.25 (max, first run)
Time taken: 0.18 (average)
After sending ten 200K messages (total 6063323 characters, 13 messages on the server):
Time taken: 0.57 (sometimes -0.43)
The results are surprising - suggestions on why there is a negative time there? Perhaps the way the
interpreter handles floating point arithmetic or fetches the time. Notice that 1-(the negative
value) is within the range of positive values that are produced.
In any case, no discernable delay exists after fetching these message headers, and definitely not
the two orders of magnitude premised in message bodies or attachments being transferred.
Verily, imap_headers() does exactly and only what it claims to do.
PMK Media
http://www.pmkmedia.com