Separate thread for loading message

POP Peeper: Tech support, suggestions, discussion, etc.
Post Reply
ppuser
Posts: 73
Joined: Thu Sep 29, 2011 6:23 am

Separate thread for loading message

Post by ppuser »

When double-clicking on a message to view it, if some accounts in the list are being checked for new mail, the process waits for the mail-check to finish and then retrieve the body of the message. If there are many accounts in the list, especially web accounts, this process may take several seconds.

A suggestion would be to speed-up the mail-viewing process either by opening a separate thread to retrieve the email body from the server or by interrupting the mail-check process, get the body and then continue the mail-check with the rest of the accounts.
User avatar
Jeff
Admin / Developer
Posts: 9433
Joined: Sat Sep 08, 2001 9:46 pm

Re: Separate thread for loading message

Post by Jeff »

This is something I've considered before, but I think -- for the most part -- wouldn't really be as beneficial as you might think. Let's (again) assume you're using IMAP when possible (because if you're not using IMAP in this type of situation, then you're shooting yourself in the foot).

First: you can define how many "maximum simultaneous threads" there can be under main menu: Tools / Options / Mail Check (General/Advanced options must be enabled). I think the current default is '3' (I think it used to be '2'). Personally, I have mine set to 8, but that's probably overkill. I once did some benchmarking and I found that values of 3-4 were the most practical; ie. given a large number of accounts with a large number of messages all to be retrieved, it wouldn't take PP significantly longer with a value of 4 vs 5. I'm only mentioning this option because you may want to tweak it -- I'm not saying it will definitively solve your problem, but if yours is low (1-2), then increasing it to 3-5 may help.

So now I'll explain why IMAP somewhat/mostly mitigates this issue -- when used in combination with the IDLE command, POP Peeper will remain connected to the server. This means that you will mostly receive new messages outside the regular polling interval. And this is important because it means that the "maximum simultaneous threads" mentioned above won't be saturated.

Also, in conjunction with the "always connected to the server", it means that the thread doesn't have to login to retrieve the message. Logging in can actually take a significant amount of time, which is also why creating another thread to just retrieve the message may not be practical either -- by the time it logs in, the "main" thread may have already freed up and taken care of it.

Out of curiosity, what is the composition of your email accounts in PP? ie. how many pop3, how many imap, etc.
ppuser
Posts: 73
Joined: Thu Sep 29, 2011 6:23 am

Re: Separate thread for loading message

Post by ppuser »

Jeff wrote: Wed Jul 24, 2024 2:34 pm This is something I've considered before, but I think -- for the most part -- wouldn't really be as beneficial as you might think. Let's (again) assume you're using IMAP when possible (because if you're not using IMAP in this type of situation, then you're shooting yourself in the foot).
Well, after your posts here, i turned the 4-5 POP accounts i had to IMAP. I have a total of 26 (mixed IMAP and a few Web now, 5-6 i think).
Jeff wrote: Wed Jul 24, 2024 2:34 pmFirst: you can define how many "maximum simultaneous threads" there can be...
Mine was at 5, so i guess i'm good...
Jeff wrote: Wed Jul 24, 2024 2:34 pm So now I'll explain why IMAP somewhat/mostly mitigates this issue -- when used in combination with the IDLE command, POP Peeper will remain connected to the server. This means that you will mostly receive new messages outside the regular polling interval. And this is important because it means that the "maximum simultaneous threads" mentioned above won't be saturated.
OK, i understand better the benefits of IMAP now, but the "IDLE command" you are referring to is just an IMAP command or there is a related setting named like that?
Jeff wrote: Wed Jul 24, 2024 2:34 pm Also, in conjunction with the "always connected to the server", it means that the thread doesn't have to login to retrieve the message. Logging in can actually take a significant amount of time, which is also why creating another thread to just retrieve the message may not be practical either -- by the time it logs in, the "main" thread may have already freed up and taken care of it.
Yes, i had noticed that it took some time for that part to be completed (in the POP accounts probably). Again, the "always connected to the server" is a setting or you are just referring to the way IMAP works?
Jeff wrote: Wed Jul 24, 2024 2:34 pm Out of curiosity, what is the composition of your email accounts in PP? ie. how many pop3, how many imap, etc.
Answered earlier...
User avatar
Jeff
Admin / Developer
Posts: 9433
Joined: Sat Sep 08, 2001 9:46 pm

Re: Separate thread for loading message

Post by Jeff »

but the "IDLE command" you are referring to is just an IMAP command or there is a related setting named like that?
Both. It should be enabled by default, but you can check; it's a per-account option:
Edit the account, on the general page: "Idle/Push" is on the bottom-right (only visible when the server type = imap)

I should also mention that some servers do not handle idle very well. They may support it (for a long time, Yahoo didn't even support it), but they'll still drop the connection far sooner than they're supposed to. Yahoo is the worst culprit; Outlook is better-ish; Gmail and most others (in my experience) handle it well.
ppuser
Posts: 73
Joined: Thu Sep 29, 2011 6:23 am

Re: Separate thread for loading message

Post by ppuser »

Great, thanks for the info. A newer check of all the accounts revealed the following: all my accounts are IMAP now but none of them has IDLE checked! I'll enable it and see what happens. I have several Yahoo ones, so it will be interesting to see if things will get better or worse...

You said "It should be enabled by default", but in a new account creation, if the Server Type is changed to IMAP, this checkbox (IDLE) is not checked. Not that i mind, but is this normal?
User avatar
Jeff
Admin / Developer
Posts: 9433
Joined: Sat Sep 08, 2001 9:46 pm

Re: Separate thread for loading message

Post by Jeff »

I just tested this by creating an account in 3 different ways:
1) Using the wizard to create an account with a made-up domain (which PP will default to pop3)
2) Using the wizard to create a @hotmail.com account and changing it to pop3 during creation
3) Importing a pop3 account from thunderbird

In each case, I then edited the account after creating it and changed the server type = imap. In all 3 cases, the "idle/push" checkbox was enabled.

It's quite possible that there was a time when PP would not have enabled idle by default in one/all of these cases and perhaps the idle value was saved (disabled) at the time of account creation. I don't specifically remember that but, as I was typing all this, it seemed it could be plausible. :-k
ppuser
Posts: 73
Joined: Thu Sep 29, 2011 6:23 am

Re: Separate thread for loading message

Post by ppuser »

Ah, ok, maybe i should have been more specific.

- Rightclick inside the accounts listbox, in the whitespace.
- Select "Create account (manual)...".
- Change the Server Type to IMAP.

In this case, the IDLE/Puch checkbox is unchecked (before the account is saved). I was referring to this case when asking if it is the normal/expected behavior.
User avatar
Jeff
Admin / Developer
Posts: 9433
Joined: Sat Sep 08, 2001 9:46 pm

Re: Separate thread for loading message

Post by Jeff »

Lul....

yeah, confirmed. I think it's fine as-is since creating an account this way really is barebones.

I was almost as likely to remove that creation method as to altering the idle checkbox. Which reminds me that a long time ago (probably in the 2000's), I had temporarily disabled that method (I think maybe I realized it was broken at the last moment or something and didn't want to delay the release) and I had mentioned it in the release notes. At least one person took this to mean that account creation was completely disabled.

Ah, yes, here it is:
v2.3.5 - January 27, 2005
- Fix: Removed advanced option to create account manually (will return in v2.4)
To the weird things I remember (and the things I can't remember that happened more recently)...
ppuser
Posts: 73
Joined: Thu Sep 29, 2011 6:23 am

Re: Separate thread for loading message

Post by ppuser »

Well, IMO if it doesn't cause any serious issues, it would be better to be left as is (that is, do not remove it). This method is useful and more clear to people who just wish to see all the fields on screen and manually fill them. Wizards sometimes may be confusing because they are designed to work in a way that seems convenient to their designer. The same "convenience" though may not apply to all people.

Take Outlook (desktop version) for instance. I really, really, REALLY hate the fact that there is only the "automatic/wizard" way of creating an account, because i have no idea what it is doing behind the scenes. It doesn't show to the user the settings used, so if at a point something breaks with the way it connects to the server, you have no way to troubleshoot it or change it to something else (i'm not talking about Exchange of course, just POP/IMAP). I'm sure the designers of this "automation" are happy with their creation though (and the choice to deny the user an additional way to manually create an account).
Post Reply