note 41540 added to function.imap-headers

From: Date: Tue, 13 Apr 2004 23:42:51 +0000
Subject: note 41540 added to function.imap-headers
Groups: php.notes 
Request: Send a blank email to php-notes+get-68098@lists.php.net to get a copy of this message
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 ---- Manual Page -- http://www.php.net/manual/en/function.imap-headers.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41540 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41540&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41540&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#68098) next »