diff options
| author | Rémy Voet (ryv) <ryv@odoo.com> | 2020-11-17 16:12:00 +0000 |
|---|---|---|
| committer | Rémy Voet (ryv) <ryv@odoo.com> | 2020-11-18 10:32:09 +0000 |
| commit | e7a43655448db161150d0c62efa14c54ade0a2f6 (patch) | |
| tree | 213f51d448c8de68b6f185ffc735e346ec0a7b97 /addons/mail/static/src/models/thread_cache | |
| parent | 0936e2da3e5c66e4050f27e994437eb219e3c85f (diff) | |
[FIX] stock: make `do_unreserve` faster than ever
`do_unreserve` is a action that can be made in the tree view of
`stock.picking` but it was very slow and not batched.
For 80 picking with -/+ 10 `stock.move.line` related each
(calculate on 5 sample of 80 pickings):
It took 17947 +- 2741 SQL requests, 7.37 +- 1.09 sec of SQL
and 8.13 +- 1.31 sec of python execution (+- 15.5 sec in total)
Make some change to speed up the unreservation of
multiple picking/move:
- Batch the call of `_do_unreserve` of move in picking
- Use OrderedSet instead of RecordSet to reduce the complexity of
`_do_unreserve`. (Become significant when len(recordset) > 1000)
- Add `.with_prefetch()` in the unlink of stock move line
to patch issue with prefetching + unlink + cache.
- Batch `_recompute_state`
- Also batch the `do_unreserve` of MO
Result after change in the same samples:
It take now 1438 +- 20 SQL requests, 0.45 +- 0.02 sec of SQL
and 0.68 +- 0.02 sec of python execution (+- 1.13 sec in total,
13 times faster). Note that the gain increase proportionally.
task-2383111
closes odoo/odoo#61879
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Diffstat (limited to 'addons/mail/static/src/models/thread_cache')
0 files changed, 0 insertions, 0 deletions
