|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-11-16 12:45 UTC] cahagn_o at epita dot fr
I (with a friend) coded a webmail client in PHP (re-written from Perl), available at: http://nocc.sourceforge.net/ It's very fast when PHP is loaded as a module with Apache (3 seconds to display a mailbox list from POP3 or IMAP server) but the CGI version takes around 2 or 3 minutes to display anything. Even when disabling the default mailbox sorting feature, it takes very long, but at least it won't fail with Windows 2k+Apache+PHP cgi with the 30 seconds max. exceeded. I know this is a light bug report but I really wonder why it's so slow, every other cgi with the same php binary is very fast and the same webmail client coded with Perl is much faster than the PHP equivalent whereas, generally speaking, for my experience, my PHP scripts are faster than my other scripts written in Perl, sh, etc. (except C :). The accessed mail servers are local and I tried NetBSD, Linux, Windows 2000. I use the latest PHP from snaps.php.net or php4win.de See http://www.epita.fr:8000/~cahagn_o/php/info.php I've been using PHP for years now, debugging it a bit (the binary is 2MB large on the NetBSD box) but this performance problem is weird. Thanks for any enlightenment. I hope you won't close this bug report for bad php coding reason, I really think there's a specific performance problem with CGI and IMAP, perhaps the IMAP library that keeps on being reloaded ? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 17:00:01 2025 UTC |
I tested imap_fetchstructure() with the pear/Benchmark/Timer.php package with the following code: [...] $timer = new Benchmark_Timer; $timer->start(); $timer->set_marker("42"); $struct_msg = @imap_fetchstructure($pop, $mail); $timer->stop(); $profiling = $timer->get_profiling(); [...] Here're the results with PHP latest snapshot as CGI on a PPro200, 256MB, and POP server being local, Apache 1.3.14, PHP binary is 2MB large (without debugging symbols). I load one mail at a time and see how long it takes for imap_fetchstructure() to parse it depending on the size: - 1KB, no attachment: 0.011 sec - 78KB, no att: 0.225 - 68KB, 1 att: 0.225 - 1428KB, 1 att: 4 to 7 seconds ! With PHP loaded as a module, it's immediate (< 1 second) During the test, the load was 0.6 and I tested several times to be sure of the results. So, to sum up: imap_fetchstructure() is slow with big mails when PHP is compiled as CGI.