I'm just pointing out that e.g. a slow connection can cause the issue, so this don't have to be Roundcube's fault. Is the IMAP server on the same host? What PHP version? What Roundcube version?
IMAP server is Dovecot 2.2.27 and it is on the same host and this host is not load by memory or CPU at all. Roundcube 1.3.7 PHP 7.0.30
Here I see that list request takes 1 second. So, where's your 5-7?
5-7 seconds were measured by watch :-(
After I wrote you that Network Profiler in browser showed me 3.5 seconds
(lets start from this point, because 5 seconds subjective, sorry)
After I disabled threads
page loaded in 1.6secs ±
1.6secs it's with tcp and tls connecting time (waiting
time is 1.2secs
which is very close to 1secs). This is our current situation.
ps. If you provide full debug log with THREAD and SORT responses I might take a look at the code and see how performant is the parsing code and if there's any culprit.
https://gist.githubusercontent.com/Alukardd/82418d77a148557fd2c4bb05bd37413d...
p.s. Thanks, for your help.