-
Notifications
You must be signed in to change notification settings - Fork 23.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FW][PERF] stock_account: batch _run_fifo_vacuum #165948
base: saas-16.3
Are you sure you want to change the base?
[FW][PERF] stock_account: batch _run_fifo_vacuum #165948
Conversation
@Aurelienvd @Whenrow cherrypicking of pull request #157558 failed. stdout:
stderr:
Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?). In the former case, you may want to edit this PR message as well. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
1041979
to
550de50
Compare
I hate to barge in here, but this change has been causing an issue in Odoo 16.0. The attached test causes an exception in Odoo 16.0 test_inventory_user_permission.zip I believe this patch should be applied before forward porting any further |
Currently _run_fifo_vacuum can be a performance bottleneck when confirming a large IN transfer. This is especially true for anglo_saxon accounting companies. To fix that, this commit introduces batch versions of _run_fifo_vacuum and _create_fifo_vacuum_anglo_saxon_expense_entry. The idea of these batch versions is to batch records creation, moves posting, search, etc. Stuff that cannot be batched/don't need to be batched are left as is. opw-3727953 X-original-commit: 22e7bfb Co-authored-by: Whenrow <whe@odoo.com>
550de50
to
d4d0c77
Compare
Currently
_run_fifo_vacuum
can be a performance bottleneck when confirming a large IN transfer. This is especially true for anglo_saxon accounting companies.To fix that, this commit introduces batch versions of
_run_fifo_vacuum
and_create_fifo_vacuum_anglo_saxon_expense_entry
. The idea of these batch versions is to batch records creation, moves posting, search, etc. Stuff that cannot be batched/don't need to be batched are left as is.Speedup
15.0 customer database with 476 000 account.moves, 1M account.move.lines,
8400 products, 700 000 stock.moves, 650 000 stock.move.lines, 500 000 svls
All categories have Inventory Valuation set to real_time.
Benchmark validation of IN transfers, changing the number of products + total number of svls
Some pickings are not directly impacted by the PR, most probably because these pickings don't have candidates svls/svls to
vacuum to begin with. Still for the fourth and fith picking, the batch version performs way better than the iterative
one.
Validating an IN transfer with stock_account and real-time inventory valuation is a complex process so it's a bit difficult to
pinpoint tables cardinalities that correlate with the validation time. Here it's the Before vs After time that is relevant, more than
the validation time growth.
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: #164295
Forward-Port-Of: #157558