We can do this somehing like on every second, third or fifth message. Do you buy this approach?
actually, I don't buy this. Pop3 download for me is so slow (because, remember, we're downloading the whole msg body instead of just the hdrs as we do for news and imap), that updating the counts doesn't significantly slow us down, and is actually useful. An approach I would buy (though I don't think it's worth it) is to only update the counts every 1/2 to 1 second or so. The complexity of this might make this not so worthwhile, because you have to make sure the last count gets updated correctly.
I know we download the entire msg. We know when we are downloading last message so we can do it on every 1/2 or 1 second and on the last message. We can use something like PR_interval to record the difference in times because everything is happening on the same thread.
I'm just saying because we download the whole message, it's a lot slower then imap or news, so that the percentage of time spent updating the count is a lot less than the percentage of time downloading the message. For example, the average pop message probably has at least 50 lines, whereas the the news hdr info comes in one line. I've had several pop3 servers from isps, over broadband connections, and I'm lucky if I get more than one or two messages downloaded per second. Given that the time to update the count is measured in microseconds, and that we're really bottlenecked on the pop3 download code, which runs on a different thread, my guess is that this is just not going to help. Does this make sense?
makes sense. marking invalid.