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] evaluation: faster dependencies checking #4125
Conversation
@LucasLefevre @rrahir cherrypicking of pull request #4093 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 |
cd415a4
to
e3d6e52
Compare
The recent refactoring of `recomputeZone` was typed such that it could only handle unbounded zones.
This commit improves the performance of a pathological case of the dependency finding algorithm. Let's say All cells in column B depends on A1 (each cell in B contains a formula referencing A1). All cells in column C depends on every cell in B What happens when we update A1: the first `while` iteration finds all cells in B, which are pushed in the process queue (B1, B2, B3, B4, ...). At the next iteration, the code searches for the dependencies of B1 and adds them to the queue (now B2, B3, B4, ..., C1, C2, C3, ...) The next iteration, we search for the dependencies of B2 which are again C1, C2, C3,... They are not pushed to the queue because we already visited them, but we still have to process them. Next is the dependencies of B3...again C1, C2, C3, ... We process over and over again the same positions. With this commit, we no longer process individual positions one after the other. We first group positions in bigger zones. With the example above, we would have grouped B1, B2, B3, ... into a single zone with the the entire B column. Hence we do a single `this.rTree.search` rather one per position. On RNG's spreadsheet, `getCellsDependingOn` total time goes from 12+ secondes to <180ms, (~90% to ~10%) when updating certain cells with the describe dependency configuration. Task: 3874821
e3d6e52
to
4552587
Compare
@robodoo r+ |
@robodoo rebase-ff |
Merge method set to rebase and fast-forward. |
The recent refactoring of `recomputeZone` was typed such that it could only handle unbounded zones. Part-of: #4125
This commit improves the performance of a pathological case of the dependency finding algorithm. Let's say All cells in column B depends on A1 (each cell in B contains a formula referencing A1). All cells in column C depends on every cell in B What happens when we update A1: the first `while` iteration finds all cells in B, which are pushed in the process queue (B1, B2, B3, B4, ...). At the next iteration, the code searches for the dependencies of B1 and adds them to the queue (now B2, B3, B4, ..., C1, C2, C3, ...) The next iteration, we search for the dependencies of B2 which are again C1, C2, C3,... They are not pushed to the queue because we already visited them, but we still have to process them. Next is the dependencies of B3...again C1, C2, C3, ... We process over and over again the same positions. With this commit, we no longer process individual positions one after the other. We first group positions in bigger zones. With the example above, we would have grouped B1, B2, B3, ... into a single zone with the the entire B column. Hence we do a single `this.rTree.search` rather one per position. On RNG's spreadsheet, `getCellsDependingOn` total time goes from 12+ secondes to <180ms, (~90% to ~10%) when updating certain cells with the describe dependency configuration. closes #4125 Task: 3874821 Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
On RNG's spreadsheet, from 12+ secondes to <180ms
Task: 3874821
Description:
description of this task, what is implemented and why it is implemented that way.
Task: : TASK_ID
review checklist
Forward-Port-Of: #4118
Forward-Port-Of: #4093