Switching from PHPMailer to Swift - Speed Issues

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

bozzaj
Forum Newbie
Posts: 11
Joined: Thu Feb 05, 2009 3:18 pm

Re: Switching from PHPMailer to Swift - Speed Issues

Post by bozzaj »

xdecock wrote:Ok, i'm on the point to commit some major changes in CharacterStream

New values:

0.75 => ArrayCharacterStream
* 0.58 => importByteStream
These two by themselves seem to be a significant change! I'll test as soon as I can.
bozzaj
Forum Newbie
Posts: 11
Joined: Thu Feb 05, 2009 3:18 pm

Re: Switching from PHPMailer to Swift - Speed Issues

Post by bozzaj »

xdecock wrote:Let us know the new performance
100 emails, with or without array cache, 61 seconds (originally 66)
Increasing _nextsequence from 4 to 8, 53 seconds
Increasing to 128, 45 seconds

Obviously, the _nextsequence change may not create correct output, but I just wanted to check.

While looking through the code, I noticed a potential problem with _standardize. In a case where the string is 76 characters and the ending character is a space or \t, the output becomes 78 characters. Am I reading this correctly?
xdecock
Forum Commoner
Posts: 37
Joined: Tue Mar 18, 2008 8:16 am

Re: Switching from PHPMailer to Swift - Speed Issues

Post by xdecock »

100 emails, with or without array cache, 61 seconds (originally 66)
Increasing _nextsequence from 4 to 8, 53 seconds
Increasing to 128, 45 seconds


Ok, so we have other bottlenecks here at works :/

if it does not contain sensitive datas, can you please send me your test case by mail ? (my screenName@gmail.com)

i'll be able to profile deeper the bottlenecks you are triggering

(yes performance work is quite a lot of little works, so i prefer begining with the most usefull )
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Switching from PHPMailer to Swift - Speed Issues

Post by Chris Corbyn »

bozzaj wrote:While looking through the code, I noticed a potential problem with _standardize. In a case where the string is 76 characters and the ending character is a space or \t, the output becomes 78 characters. Am I reading this correctly?
I'll put together a test case to check. Thanks for being so specific, that's very helpful :)

Xavier is god!
xdecock
Forum Commoner
Posts: 37
Joined: Tue Mar 18, 2008 8:16 am

Re: Switching from PHPMailer to Swift - Speed Issues

Post by xdecock »

Chris Corbyn wrote:Xavier is god!
I'm here incognito, don't repeat it XD
xdecock
Forum Commoner
Posts: 37
Joined: Tue Mar 18, 2008 8:16 am

Re: Switching from PHPMailer to Swift - Speed Issues

Post by xdecock »

Completely new CharacterStream Class
+ reworked CharacterReaders
, should speedup things a bit

However, it has not been optimized, so those results are preliminary tests:
[Vanilla (master branches, without new reader)]

Code: Select all

xavier@desktop-xavier:~/swift/vanilla/test-suite$ time php run.php Swift_Mime_ContentEncoder_QpContentEncoderAcceptanceTest
Swift_Mime_ContentEncoder_QpContentEncoderAcceptanceTest
OK
Test cases run: 1/1, Passes: 12, Failures: 0, Exceptions: 0
 
real    0m5.112s
user    0m3.052s
sys     0m1.728s
[NgCharacterStream]

Code: Select all

xavier@desktop-xavier:~/swift/swiftmailer/test-suite$ time php run.php Swift_Mime_ContentEncoder_QpContentEncoderAcceptanceTest
Swift_Mime_ContentEncoder_QpContentEncoderAcceptanceTest
OK
Test cases run: 1/1, Passes: 12, Failures: 0, Exceptions: 0
 
real    0m2.998s
user    0m1.912s
sys     0m0.924s
I still have some loops that needs optimizations however, but the first thing to do was making the proof of concept

PS: To DL, go there: http://github.com/swiftmailer/swiftmail ... 12c6c9/lib and click download (can't find the good link)
bozzaj
Forum Newbie
Posts: 11
Joined: Thu Feb 05, 2009 3:18 pm

Re: Switching from PHPMailer to Swift - Speed Issues

Post by bozzaj »

Chris Corbyn wrote:I'll put together a test case to check. Thanks for being so specific, that's very helpful :)
You're welcome - Just let me know when I don't give enough information. :)
bozzaj
Forum Newbie
Posts: 11
Joined: Thu Feb 05, 2009 3:18 pm

Re: Switching from PHPMailer to Swift - Speed Issues

Post by bozzaj »

xdecock wrote:Completely new CharacterStream Class
+ reworked CharacterReaders
, should speedup things a bit
Finally had a chance to test this. Using the same body.html I've been using:

100 emails: (Edit: 4.0b5 is actually 4.0b5 with improvements previously made)
4.0b5, array cache, send - 61 seconds
ng, array cache, send - 66 seconds
4.0b5, array cache, batchsend - 62 seconds
ng, array cache, batchsend - 66 seconds
4.0b5, disk cache, send - 62 seconds
ng, disk cache, send - 66 seconds
4.0b5, disk cache, batchsend - 62 seconds
ng, disk cache, batch send - 67 seconds

Fairly consistent regardless of which style (array/batch settings) I use.

Let me know if there's anything else you need from me!
xdecock
Forum Commoner
Posts: 37
Joined: Tue Mar 18, 2008 8:16 am

Re: Switching from PHPMailer to Swift - Speed Issues

Post by xdecock »

i'll check a way to re-gain speed as fast as i can, but i have little time for the moment.
bozzaj
Forum Newbie
Posts: 11
Joined: Thu Feb 05, 2009 3:18 pm

Re: Switching from PHPMailer to Swift - Speed Issues

Post by bozzaj »

xdecock wrote:i'll check a way to re-gain speed as fast as i can, but i have little time for the moment.
No worries - I know that these things take time.
Post Reply