From 50dc1d25d2dcc3492dac0390fcbadad9d7f663f1 Mon Sep 17 00:00:00 2001 From: Dushusir <1414556676@qq.com> Date: Mon, 21 Oct 2024 11:48:31 +0800 Subject: [PATCH] fix(formula): calculate performance --- .../commands/mutations/set-formula-calculation.mutation.ts | 4 +--- .../src/controllers/trigger-calculation.controller.ts | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/engine-formula/src/commands/mutations/set-formula-calculation.mutation.ts b/packages/engine-formula/src/commands/mutations/set-formula-calculation.mutation.ts index 0e0119b35c2..e64f09bdf22 100644 --- a/packages/engine-formula/src/commands/mutations/set-formula-calculation.mutation.ts +++ b/packages/engine-formula/src/commands/mutations/set-formula-calculation.mutation.ts @@ -45,9 +45,7 @@ export interface ISetFormulaCalculationNotificationMutation { export const SetFormulaCalculationNotificationMutation: IMutation = { id: 'formula.mutation.set-formula-calculation-notification', type: CommandType.MUTATION, - handler: () => { - return true; - }, + handler: () => true, }; export interface ISetFormulaCalculationResultMutation { diff --git a/packages/sheets-formula/src/controllers/trigger-calculation.controller.ts b/packages/sheets-formula/src/controllers/trigger-calculation.controller.ts index 9256e5eefb9..de499a0526c 100644 --- a/packages/sheets-formula/src/controllers/trigger-calculation.controller.ts +++ b/packages/sheets-formula/src/controllers/trigger-calculation.controller.ts @@ -203,8 +203,6 @@ export class TriggerCalculationController extends Disposable { this._commandService.executeCommand(SetFormulaCalculationStartMutation.id, { ...this._executingDirtyData }, lo); - this._startExecutionTime = performance.now(); - this._waitingCommandQueue = []; }, 100); }) @@ -341,6 +339,8 @@ export class TriggerCalculationController extends Disposable { const { startCalculate, formulaCount } = command.params as ISetFormulaCalculationNotificationMutation; if (startCalculate) { + this._startExecutionTime = performance.now(); + // Increment the calculation process count and assign a new ID calculationProcessCount++;