-
- Downloads
[FIX] mail: speed up read_progress_bar
This commit fixes the performance issue in getting statistics for ``activity_state`` (colored clock icon for overdue/today/planned) in CRM. The query has been tested for several years on a large database (Odoo's own production database). Performance test on 29 K crm.lead records (activity_state): With a filter for 10 records: ``` | measurement | before | after | |--------------------+--------+-------| | number of queries | 25 | 5 | | query time, ms | 12 | 95 | (*) | remaining time, ms | 32 | 7 | ``` All records: ``` | measurement | before | after | |--------------------+--------+-------| | number of queries | 1326 | 5 | | query time, ms | 1739 | 129 | | remaining time, ms | 47934 | 17 | ``` As we can see in the last results, the time went from almost 50 seconds (not responsive at all) to 150 milliseconds (responsive). The time increase in (*) may be caused by imperfect measurements, which are raw and not averaged measures. --- opw-2346901 task-1915411 closes odoo/odoo#67004 Signed-off-by:Raphael Collet (rco) <rco@openerp.com> Co-authored-by:
Nicolas Seinlet <nse@odoo.com>
Showing
- addons/mail/models/mail_activity.py 67 additions, 0 deletionsaddons/mail/models/mail_activity.py
- addons/test_mail/models/test_mail_models.py 1 addition, 0 deletionsaddons/test_mail/models/test_mail_models.py
- addons/test_mail/tests/__init__.py 1 addition, 0 deletionsaddons/test_mail/tests/__init__.py
- addons/test_mail/tests/test_read_progress_bar.py 68 additions, 0 deletionsaddons/test_mail/tests/test_read_progress_bar.py
Please register or sign in to comment