Skip to content

Commit 1d0c6be

Browse files
fix(perf): avoid superfluous timer wrappings in watch mode (#5114)
* fix(perf): avoid superfluous timer wrappings in watch mode * Track timer instrumentation on plugins --------- Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com> Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
1 parent e9fef3f commit 1d0c6be

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils/timers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ const TIMED_PLUGIN_HOOKS: readonly (keyof PluginHooks)[] = [
104104
];
105105

106106
function getPluginWithTimers(plugin: any, index: number): Plugin {
107+
if (plugin._hasTimer) return plugin;
108+
plugin._hasTimer = true;
107109
for (const hook of TIMED_PLUGIN_HOOKS) {
108110
if (hook in plugin) {
109111
let timerLabel = `plugin ${index}`;

0 commit comments

Comments
 (0)