Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: Create plain message from html is slow Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Sergei
Newbie
Newbie


Joined: 27 September 2011
Online Status: Offline
Posts: 16
Posted: 01 November 2011 at 1:50am | IP Logged Quote Sergei

Hi,

I've been optimizing perormance of the message sending and found that if I try to save message into stream then plain text for my message would be automatically generated. I found that this happen due to default flag on Builder.HtmlToPlainMode which is equals to HtmlToPlainAutoConvert.IfNoPlain.

That's not the problem, because I actually need that functionality. The problem is that if I try to save 15 thousands of messages I will get significant performance penalty. I analyzed the code via jetbrains dotTrace and found that a lot of time is spent on creating and running Regular expressions that are used to parse html body of the message. Moreover, I can see that .ctor method is called too often, which takes almost 2 seconds in my case.

Could you please enhance your code and:

* make your regular expressions static and readonly, so they would be instantiated only once per application running

* add RegexOptions.Compiled flag to every regular expression. That would significantly decrease execution time.
Back to Top View Sergei's Profile Search for other posts by Sergei
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 01 November 2011 at 5:02am | IP Logged Quote Igor

I have checked this with lead developer of MailBee.NET Objects, and we absolutely agree on this. We'll make sure those changes are implemented soon.

Thank you for your invaluable contribution!

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 10 November 2011 at 6:08am | IP Logged Quote Igor

An updated DLL is now available for download. Thanks again!

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide