-
Notifications
You must be signed in to change notification settings - Fork 31
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
[PERF] evaluation: faster spreading invalidation #4203
Conversation
129c140
to
e3bf587
Compare
ok IMO |
7dd07f8
to
11ec7e7
Compare
11ec7e7
to
8005562
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@laa-odoo @LucasLefevre : two small comments but else LGTM :) Nice improvement !
const arrayFormulaPosition = this.getArrayFormulaSpreadingOn(position); | ||
if (arrayFormulaPosition) { | ||
// ignore the formula spreading on the position. Keep only the blocked ones | ||
arrayFormulaPositions.delete(arrayFormulaPosition); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can remove it directly from arrayFormulas
instead of adding it in arrayFormulaPositions
and then remove it from the same set ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem is that arrayFormulas
is typed as Iterable<CellPosition>
(which I think is a good think because it makes it decoupled from the internal implementation). So we can't just remove a position from it.
Since 0467161 `getCellsDependingOn` is much faster but has a higher fixed cost overhead because it instanciates a `BinaryGrid`. It is very fast to use but a bit costly to create (it creates a 2d array proporional to the size of sheets). If you do it 10k times, it starts to add up... In `invalidateSpreading`, `getCellsDependingOn` was called once for each child position (which can be a lot if the formula spreads on a lot of cells). With this commit, it's called only once, with all positions batched. For the same reason, `getArrayFormulasBlockedBy` is also batched in this commit. The speed improvement spent in `invalidateSpreading` is ~10x faster. Task: 3925565
8005562
to
8f29eeb
Compare
@robodoo r+ |
Since 0467161 `getCellsDependingOn` is much faster but has a higher fixed cost overhead because it instanciates a `BinaryGrid`. It is very fast to use but a bit costly to create (it creates a 2d array proporional to the size of sheets). If you do it 10k times, it starts to add up... In `invalidateSpreading`, `getCellsDependingOn` was called once for each child position (which can be a lot if the formula spreads on a lot of cells). With this commit, it's called only once, with all positions batched. For the same reason, `getArrayFormulasBlockedBy` is also batched in this commit. The speed improvement spent in `invalidateSpreading` is ~10x faster. closes #4203 Task: 3925565 Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Description:
description of this task, what is implemented and why it is implemented that way.
Task: : 3925565
review checklist