[FIX] spreadsheet: mark pivot cell faster

In HBA's demo sheet, `markAsValueUsed` goes from more than 2% of the total
loading time to less than 1%

closes odoo/odoo#138166

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
This commit is contained in:
Lucas Lefèvre (lul)
2023-10-10 11:07:59 +00:00
parent 9579799cb7
commit 1bc0cea716
@@ -216,8 +216,7 @@ export class SpreadsheetPivotModel extends PivotModel {
* Check if the given domain with the given measure has been used
*/
isUsedValue(domain, measure) {
const tag = [measure, ...domain];
return this._usedValueDomains.has(tag.join());
return this._usedValueDomains.has(measure + "," + domain.join());
}
/**
@@ -231,8 +230,7 @@ export class SpreadsheetPivotModel extends PivotModel {
* Indicate that the given domain has been used with the given measure
*/
markAsValueUsed(domain, measure) {
const toTag = [measure, ...domain];
this._usedValueDomains.add(toTag.join());
this._usedValueDomains.add(measure + "," + domain.join());
}
/**