Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions benchmark/react/rspeedy-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ declare const Codspeed: {
startBenchmark(): void;
stopBenchmark(): void;
setExecutedBenchmark(name: string): void;
zeroStats(): void;
};

declare const __REPO_FILEPATH__: string;
21 changes: 17 additions & 4 deletions benchmark/react/src/patchProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,32 @@ if (__BACKGROUND__) {
console = { ...console };
}

const PREFIX = __REPO_FILEPATH__.split('/').slice(0, -2).join('/');
const ignored: Record<string, boolean> = {};
const stack: string[] = [];
Comment thread
hzy marked this conversation as resolved.

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!();
});
Comment thread
hzy marked this conversation as resolved.
2 changes: 1 addition & 1 deletion packages/lynx/benchx_cli/scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ console.log('noop')
}

const COMMIT = 'f557bc907f8eac7d45386d493dea9b808d98dd7d';
const PICK_COMMIT = '471ebc337ca762e08de0d1e488e21ed79c8107c1';
const PICK_COMMIT = '033e8243747fa0b3ffc01e4b2df321d73a30597f';

Comment thread
hzy marked this conversation as resolved.
function checkCwd() {
try {
Expand Down
Loading