(Apparently, I should write more followups to mailing list articles. Maybe then I'd finally learn to use f/F instead of r/R... I did NOT intend to send the first reply privately.) Lars Magne Ingebrigtsen writes: > Aha! nnml already does it the other way around -- it looks at the > actual articles in the group, and then works on the intersection > between the articles it's asked to expire and the ones it knows > exists. nnfolder, on the other hand, just iterates over the entire > list of expirable articles, which results in a call to > `nnfolder-goto-article' for each article in the list. That must be > slooow... I looked at this about a year ago, since I was using nnfolder for some large groups (for example, for the linux-kernel mailing list) and it was taking forever to expire those groups. I came to the same conclusion you just did. AFAICT, nnfolder-request-expire-articles is often called with a huge list of articles, because of holes or whatever. Then, it iterates through that entire list, and for each article, it searches the entire buffer until it finds the article. But most of the article numbers don't exist, and for them the *entire* buffer is searched each time... I rewrote that part so that it first finds all article numbers (which shouldn't take that much more time than searching for a single non-existing article, since in each case the entire buffer has to be scanned), then intersects that with the articles it should expire. Back then, I had no idea that nnml did it that way. Anyway, I wrote that code a year ago and promptly forgot all about sending in a patch or anything. But here it is, ported to pgnus 0.95, in case anyone is interested. It seems to work on my system, but I can't guarantee that it will work on anyone else's or that I haven't made stupid assumptions that won't hold all the time -- I'm not exactly familiar with the internal workings of Gnus.