-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance improvement, my solution #154
Comments
…D to SE_FREE and added PHPUnit tests
SE_FREE is usually faster, because it's just an incremental ID starting at 1 while SE_UID is the unique ID for each email, which needs to be retrieved somewhere first. Retrieving the UID takes usually some time and depending on the server, it's sometimes faster or slower. I've committed a change, which allows user of this library to change this option: $mailbox->getImapSearchOption(); // Default is SE_UID
$mailbox->setImapSearchOption(SE_FREE); // Note: Parameter must be a constant!
$mailbox->getImapSearchOption(); // We changed it, so it will return SE_FREE The new functions will be included in the next release. |
- Updated README - Move phpunit to require-dev - Add note about installing dev dependencies in README - Replaced spaces with tabs - Added PHPUnit tests for MIME decoding - Updated formatting of PHPUnit function testParsedDateTimeWithEmptyHeaderDate() - Issue #209: Function to parse datetime correctly RFC2822 - Issue #280: Added 'Sender' to headers and added additional if-conditions - Issue #115: getMail() method returns an object even for nonexistent mail ID - Issue #273: Added connection check to example - Issue #227: Added Failed-Recipients to IncomingMailHeader - Issue #140, #246: Improved exception handling and added PHPUnit test - Issue #140: Added PHPUnit test for testing ConnectionException - Issue #140: Improved exception / error handling and improved / added PHPUnit tests - Issue #154: Added ability to change the imap_search option from SE_UID to SE_FREE and added PHPUnit tests - Issue #306: Added support for US-ASCII and added ability to disable serverEncoding for searchMailbox() - Imported missing namespaces to avoid 'unknown class' error messages - Issue #86: Simplified and improved one replace regex for attachment file names - Issue #247: Improved grabbing of fromName, fromHost, senderName and senderHost - Issue #39, #71, #229: Fixed body content gets incorrectly processed as attachments - Issue #122, #150, #167: Added ability to skip processing of attachments to increase performance, when attachments are not required - PR #284: Added missing PHPUnit tests - Issue #122, #150, #167: Lazy load message text and attachments data
Hello,
I'm using this bundle in company project. When I connected mailbox with 18000+ mails in INBOX folder and tried to load them all (don't ask why ;)) it took forever. After some research I learned that mails can be fetched by sequence number or UID. So I extended your Mailbox Class and done the following:
SE_FREE instead of SE_UID
and:
0 instead of FT_UID.
Those two changes made execution of imap_fetch_overview ~15 times faster. For example fetching 8000 mails took 90.4 seconds on stock and 5.6 seconds with above changes. I compared the search results (to check if some emails where missed) with both methods and they were same.
However, if given range of emails is fetched for the first time it takes equal time in both cases. Only following fetches are faster with my method.
Could you explain this case for me?
The text was updated successfully, but these errors were encountered: