#473 improve performance of threaded view

closed-accepted
nobody
5
2011-04-18
2011-04-16
Siim Põder
No

On my low-endish server, a mailbox with 4K threads takes ~15s to render the threaded mail view, 99% of that time being spent in functions/imap_messages.php get_parent_level. Appears that almost all of that time is spent calculating the array length at the end clauses of for loops. Calculating the array lengths once before the loops and using those in the exit clauses gives a roughly 10-fold speedup for my workload. Patch attached.

Discussion

    • status: open --> closed-accepted
     
  • Accepted (with a tiny bit more massaging) and committed. This is available in our repository immediately and in our snapshot downloads within 24 hours. Many thanks.