diff --git a/benchmark/react/rspeedy-env.d.ts b/benchmark/react/rspeedy-env.d.ts index f0ee0e95e5..bed4b6ec3c 100644 --- a/benchmark/react/rspeedy-env.d.ts +++ b/benchmark/react/rspeedy-env.d.ts @@ -8,6 +8,7 @@ declare const Codspeed: { startBenchmark(): void; stopBenchmark(): void; setExecutedBenchmark(name: string): void; + zeroStats(): void; }; declare const __REPO_FILEPATH__: string; diff --git a/benchmark/react/src/patchProfile.ts b/benchmark/react/src/patchProfile.ts index bb4bc660c4..755f7da113 100644 --- a/benchmark/react/src/patchProfile.ts +++ b/benchmark/react/src/patchProfile.ts @@ -9,19 +9,32 @@ if (__BACKGROUND__) { console = { ...console }; } +const PREFIX = __REPO_FILEPATH__.split('/').slice(0, -2).join('/'); +const ignored: Record = {}; const stack: string[] = []; hook(console, 'profile', (old, name) => { old!(name); - stack.push(name!); + if ( + (ignored[name!] ??= name === 'commitChanges' + || name!.startsWith('ReactLynx::diff::')) + ) { + stack.push('__IGNORED__'); + } else { + stack.push(name!); + } Codspeed.startBenchmark(); }); hook(console, 'profileEnd', (old) => { Codspeed.stopBenchmark(); const name = stack.pop(); - Codspeed.setExecutedBenchmark( - `${__webpack_public_path__}::${__webpack_chunkname__}-${name!}`, - ); + if (name === '__IGNORED__') { + Codspeed.zeroStats(); + } else { + Codspeed.setExecutedBenchmark( + `${PREFIX}::${__webpack_chunkname__}-${name!}`, + ); + } old!(); }); diff --git a/packages/lynx/benchx_cli/scripts/build.mjs b/packages/lynx/benchx_cli/scripts/build.mjs index 6afd924b25..32e2d1e375 100644 --- a/packages/lynx/benchx_cli/scripts/build.mjs +++ b/packages/lynx/benchx_cli/scripts/build.mjs @@ -30,7 +30,7 @@ console.log('noop') } const COMMIT = 'f557bc907f8eac7d45386d493dea9b808d98dd7d'; -const PICK_COMMIT = '471ebc337ca762e08de0d1e488e21ed79c8107c1'; +const PICK_COMMIT = '033e8243747fa0b3ffc01e4b2df321d73a30597f'; function checkCwd() { try {