Ed W wrote:
That said, if I turn off threading then these times drop to circa 1 second or so, so threading is still taking a massive amount of CPU?
and memory
Just looking at the massive amount of data coming back from the imap server I can't help wondering if we couldn't request less data?
I don't think so. You could try to change sorting to Date or None. In this case SORT command will be skipped.
In the whole THREAD response parsing operation most time-consuming part is the rcube_imap_generic::parseThread() function, but I didn't found a way to make it faster.