imap_open function performance

I have serioues issues with php imap extension.

I am developing imap web client and i have performance problem with imap_open function only, the function takes 2-3 minutes in execution, later operations like fetching mail etc. are performing well (few seconds). The size of mailbox is 21GB, so it's quite big, but periodically browsing mails is performing well (fetching 10 mail takes 4 seconds), even if this is the first call, so mails are not cached, but mostly the perfomance is very poor and benchmarking shows that the imap_open function takes longest. Are there any tricks to make it faster?