6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
11/8/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#14075] Large mailboxes takes many seconds to load and causes CPU at 100%
*
Your Email Address
*
Spam protection
Enter the letters below:
..__ .__. __ .___ || \| |/ `[__ \__||__/|__|\__.|
Comment
> The library in question is Horde_Imap_Client. > > The class where the performance problem reside is > Horde_Imap_Client_Data_Thread. > > And the method causing the high CPU usage is _getAllIndices(). > > This method uses a simple iteration through _thead array (in my case > having 8088 elements) and merges the keys of each sub-array with the > previous one. So it calls array_merge and array_keys 8088 times: > > protected function _getAllIndices() > { > $out = array(); > reset($this->_thread); > while (list(,$v) = each($this->_thread)) { > $out = array_merge($out, array_keys($v)); > } > > return $out; > } > > I replaced this iteration with this and the performance issue were gone: > > protected function _getAllIndices() > { > return array_keys(call_user_func_array('array_replace', > $this->_thread)); > } > > Hope it helps and best regards, > > Cristiano da Cunha Duarte
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers