When loading/reading emails from the hard disk it's very slow is there anything to do about it ?
Closed this issue · 1 comments
Slow i mean in many cases the hard disk think a lot or the program even stop for some seconds.
This is my code in a backgroundworker dowork event
int countUploadMsg = 0; private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e) { int counter = 0; allLoadedMessages = new List<OpenPop.Mime.Message>(); OpenPop.Mime.Message loadedMessage = null; DirectoryInfo di = new DirectoryInfo(@"e:\testmail\"); FileInfo[] files = di.GetFiles();//new FileInfo(@"e:\testmail\" + emailNumber + ".eml"); foreach (FileInfo file in files) { loadedMessage = OpenPop.Mime.Message.Load(file); allLoadedMessages.Add(loadedMessage); counter += 1; int nProgress = counter * 100 / files.Length; backgroundWorker2.ReportProgress(nProgress); } }
It's working but get slow in some places while loading/reading the emails from the hard disk.
The files on the hard disk are .eml the biggest are 8.5MB and htere are smaller like 23KB
I saw this problem with someone else here:
http://stackoverflow.com/questions/24364402/how-to-parse-emails-faster-than-openpop-dll
There is explaining there about the problem but the solution is to work with other library and i want to keep working with OpenPop. The question is if there is anything to do with this problem ?