Skip to content

Commit

Permalink
fix(perf): avoid superfluous timer wrappings in watch mode (#5114)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people committed Sep 10, 2023
1 parent e9fef3f commit 1d0c6be
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/timers.ts
Expand Up @@ -104,6 +104,8 @@ const TIMED_PLUGIN_HOOKS: readonly (keyof PluginHooks)[] = [
];

function getPluginWithTimers(plugin: any, index: number): Plugin {
if (plugin._hasTimer) return plugin;
plugin._hasTimer = true;
for (const hook of TIMED_PLUGIN_HOOKS) {
if (hook in plugin) {
let timerLabel = `plugin ${index}`;
Expand Down

0 comments on commit 1d0c6be

Please sign in to comment.