PHP Classes

Normal mode from data very slow with big email

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  Normal mode from data very slow with...  >  (Un) Subscribe thread alerts  
Subject:Normal mode from data very slow with...
Summary:Normal mode from data very slow with big email
Messages:2
Author:Christophe Charron
Date:2008-07-02 16:52:08
Update:2008-07-02 19:39:57
 

  1. Normal mode from data very slow with...   Reply   Report abuse  
Picture of Christophe Charron Christophe Charron - 2008-07-02 16:52:08
Hi,

parsing an email in "normal" mode seems to be efficient in all cases but parsing the same mails with "normalfromdata" takes a very very long time. Most of time but not always. Do you have any explanation to this ? Must I change my scripts to use "normal (file)" instead of "normalfrom data" or is it a bug ?

Above, 3 samples with "big" emails. The biggest even failed once because i was doing something else.

20012131_message-slow.eml 2 258 136 -> 2008-07-02T16:52:13+02:00 Test "normal": ... OK 2008-07-02T16:52:21+02:00 Test "normalfromdata": ... OK 2008-07-02T16:53:40+02:00 2 test were performed, none has failed.
message-very-slow.eml 4 096 734 -> 2008-07-02T16:55:56+02:00 Test "normal": ... OK 2008-07-02T16:56:07+02:00 Test "normalfromdata": ...
Fatal error: Maximum execution time of 300 seconds exceeded in C:\wamp\moi\graal_travail\exemples_applicatifs\mimeparser-2008-06-14\mime_parser.php on line 425
message-very-slow.eml 4 096 734 -> 2008-07-02T17:03:20+02:00 Test "normal": ... OK 2008-07-02T17:03:32+02:00 Test "normalfromdata": ... OK 2008-07-02T17:07:54+02:00 2 test were performed, none has failed.
2008-07-02-test-fast.eml 3 560 893 -> 2008-07-02T17:10:15+02:00 Test "normal": ... OK 2008-07-02T17:10:25+02:00 Test "normalfromdata": ... OK 2008-07-02T17:10:37+02:00 2 test were performed, none has failed.

I used test.php and just modified it to echo date.
You can download the files here :

test03.christophe-charron.org/publi ...
test03.christophe-charron.org/publi ...
test03.christophe-charron.org/publi ...



Thanks for all your help.

Best regards,
Christophe Charron

  2. Re: Normal mode from data very slow with...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-07-02 19:39:57 - In reply to message 1 from Christophe Charron
I don't know what can be the difference that causes slow down. Maybe when you load the whole message in memory it takes too much memory to parse and that may exhaust you machine RAM making it use virtual (swapped) memory.

I have not had the time to benchmark the class, but I am sure that since it provide so much parsing flexibility, there is room for optimizations.

I welcome anybody with time to perform some profiling to identify potential spots for improvements that can make a big performance difference. If you are available and can do that, just let me know what you find out so eventual performance improvements can be applied.