diff options
| author | Loan (lse) <lse@odoo.com> | 2020-08-21 15:24:56 +0000 |
|---|---|---|
| committer | Loan (lse) <lse@odoo.com> | 2020-08-25 07:27:01 +0000 |
| commit | 488ba8b3541f6e00e69db9b74f3a229bd405a5c6 (patch) | |
| tree | 634f0b5caab5298ddaa2e41941d3cfb409197e51 /addons/mail/static/src/models/thread_cache | |
| parent | 346ecc3a52a7d1c3a2c6409a6799f6b013c3b6da (diff) | |
[FIX] sale_coupon: Better performance
On instances with a lot of coupons programs, performance issue arise while using eccommerce (adding item in basket ant opening it in particular).
In the client case, he have ~2000 of them.
Opening the basket with 1 product take:
Before this commit: ~10s
After this commit: ~2s
( pyflame is available in the ticket attachment )
`_get_valid_products` use the v13 `filtered_domain` method
Average execution time:
Before change: 0.001 s
After change: 0.0001 s
=> 10x times gained
The average execution time of `_is_valid_product` is 0.002 s (20 times slower than `_get_valid_products` for the same result).
=> All use of `_is_valid_product` were replaced by `_get_valid_products`
OPW-2323599
closes odoo/odoo#56457
X-original-commit: c3a9738e25dbd773e3ee7c2175e62219346ef764
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/thread_cache')
0 files changed, 0 insertions, 0 deletions
