From dcd97da817efeb6c8646bc6a0356acb33ec568e5 Mon Sep 17 00:00:00 2001 From: Vemparala Surya Vamsi <121419957+vsvamsi1@users.noreply.github.com> Date: Mon, 8 Apr 2024 09:57:16 +0530 Subject: [PATCH] chore: remove redundant evalTreeWithChanges calls during plugin page load call (#32459) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Removed redundant evalTreeWithChanges calls made during plugin on load execution. We have noticed a 30% reduction in both main thread and web worker scripting. Fixes #32475 ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!IMPORTANT] > Workflow run: > Commit: `0446a81d087ad975f12cd8e3a83c10380b5eb52d` > Cypress dashboard url: Click here! > All cypress tests have passed 🎉🎉🎉 ## Summary by CodeRabbit ## Summary by CodeRabbit - **Refactor** - Streamlined the execution logic for page load actions to improve performance and code clarity. --- .../sagas/ActionExecution/PluginActionSaga.ts | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts index 6f21f05e81..2a7b8c1aaa 100644 --- a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts +++ b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts @@ -1213,15 +1213,7 @@ function* executePageLoadAction( data: payload, }), ); - yield put( - updateActionData([ - { - entityName: action.name, - dataPath: "data", - data: payload.body, - }, - ]), - ); + PerformanceTracker.stopAsyncTracking( PerformanceTransactionName.EXECUTE_ACTION, { @@ -1276,15 +1268,7 @@ function* executePageLoadAction( undefined, pageAction.id, ); - yield put( - updateActionData([ - { - entityName: action.name, - dataPath: "data", - data: payload.body, - }, - ]), - ); + yield take(ReduxActionTypes.SET_EVALUATED_TREE); } }