-
Notifications
You must be signed in to change notification settings - Fork 8
Add necessary flags to dump optimized inlining info and fix walltime marker placement #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
GuillaumeLagrange
merged 6 commits into
main
from
cod-2821-v8-maglevturbofan-inlining-loses-nested-inline-information
Jun 22, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1fb37ef
feat(core): emit V8 jitdump and code log for walltime profiling
GuillaumeLagrange e07237e
fix(tinybench-plugin): fix profiler capturing tinybench's internal fu…
GuillaumeLagrange 2475d5b
fix(vitest-plugin): bracket walltime window around the measured loop …
GuillaumeLagrange 4601945
fix(tinybench-plugin): support tinybench v5 and v6
GuillaumeLagrange 8f2de3c
ci: use samply profiler for walltime integration tests
GuillaumeLagrange 16bf967
feat: to fixup tinybench marker clean up
GuillaumeLagrange File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "with-tinybench-v5", | ||
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "bench-tinybench": "node --loader esbuild-register/loader -r esbuild-register tinybench.ts", | ||
| "typecheck": "tsc --noEmit --pretty" | ||
| }, | ||
| "devDependencies": { | ||
| "@codspeed/tinybench-plugin": "workspace:*", | ||
| "esbuild-register": "^3.4.2", | ||
| "tinybench": "^5.1.0", | ||
| "typescript": "^5.1.3" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { withCodSpeed } from "@codspeed/tinybench-plugin"; | ||
| import { Bench } from "tinybench"; | ||
|
|
||
| function recursiveFibonacci(n: number): number { | ||
| if (n < 2) { | ||
| return n; | ||
| } | ||
| return recursiveFibonacci(n - 1) + recursiveFibonacci(n - 2); | ||
| } | ||
|
|
||
| // The plugin resolves tinybench's `Bench` type from the version hoisted at the | ||
| // monorepo root, which differs from the major pinned in this example. A real | ||
| // consumer has a single installed tinybench, so this mismatch is local to the | ||
| // workspace; `@ts-expect-error` keeps the example typechecking and flags us if | ||
| // the discrepancy ever resolves on its own. | ||
| // @ts-expect-error cross-version Bench type mismatch within the monorepo | ||
| const bench = withCodSpeed(new Bench({ time: 100, warmup: true })); | ||
|
|
||
| bench | ||
| .add("recursive fibo 10", () => { | ||
| recursiveFibonacci(10); | ||
| }) | ||
| // Register the per-task hooks so the plugin's handling of them is exercised. | ||
| .add( | ||
| "recursive fibo 15 with hooks", | ||
| () => { | ||
| recursiveFibonacci(15); | ||
| }, | ||
| { | ||
| beforeAll() {}, | ||
| beforeEach() {}, | ||
| afterEach() {}, | ||
| afterAll() {}, | ||
| }, | ||
| ); | ||
|
|
||
| bench.run().then(() => { | ||
| console.table(bench.table()); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "lib": ["es2023"], | ||
| "module": "ESNext", | ||
| "target": "es2022", | ||
| "strict": true, | ||
| "esModuleInterop": true, | ||
| "skipLibCheck": true, | ||
| "forceConsistentCasingInFileNames": true, | ||
| "moduleResolution": "Node" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "with-tinybench-v6", | ||
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "bench-tinybench": "node --loader esbuild-register/loader -r esbuild-register tinybench.ts", | ||
| "typecheck": "tsc --noEmit --pretty" | ||
| }, | ||
| "devDependencies": { | ||
| "@codspeed/tinybench-plugin": "workspace:*", | ||
| "esbuild-register": "^3.4.2", | ||
| "tinybench": "^6.0.2", | ||
| "typescript": "^5.1.3" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { withCodSpeed } from "@codspeed/tinybench-plugin"; | ||
| import { Bench } from "tinybench"; | ||
|
|
||
| function recursiveFibonacci(n: number): number { | ||
| if (n < 2) { | ||
| return n; | ||
| } | ||
| return recursiveFibonacci(n - 1) + recursiveFibonacci(n - 2); | ||
| } | ||
|
|
||
| // The plugin resolves tinybench's `Bench` type from the version hoisted at the | ||
| // monorepo root, which differs from the major pinned in this example. A real | ||
| // consumer has a single installed tinybench, so this mismatch is local to the | ||
| // workspace; `@ts-expect-error` keeps the example typechecking and flags us if | ||
| // the discrepancy ever resolves on its own. | ||
| // @ts-expect-error cross-version Bench type mismatch within the monorepo | ||
| const bench = withCodSpeed(new Bench({ time: 100, warmup: true })); | ||
|
|
||
| bench | ||
| .add("recursive fibo 10", () => { | ||
| recursiveFibonacci(10); | ||
| }) | ||
| // Register the per-task hooks so the plugin's handling of them is exercised. | ||
| .add( | ||
| "recursive fibo 15 with hooks", | ||
| () => { | ||
| recursiveFibonacci(15); | ||
| }, | ||
| { | ||
| beforeAll() {}, | ||
| beforeEach() {}, | ||
| afterEach() {}, | ||
| afterAll() {}, | ||
| }, | ||
| ); | ||
|
|
||
| bench.run().then(() => { | ||
| console.table(bench.table()); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "lib": ["es2023"], | ||
| "module": "ESNext", | ||
| "target": "es2022", | ||
| "strict": true, | ||
| "esModuleInterop": true, | ||
| "skipLibCheck": true, | ||
| "forceConsistentCasingInFileNames": true, | ||
| "moduleResolution": "Node" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { Bench, Hook } from "tinybench"; | ||
|
|
||
| // The benchmark options tinybench resolves: timing knobs plus the suite-level | ||
| // setup/teardown hooks. tinybench guarantees `setup`/`teardown` are populated | ||
| // (at least with no-op defaults), so they are non-optional here. | ||
| export interface ResolvedBenchOptions { | ||
| setup: Hook; | ||
| teardown: Hook; | ||
| warmup?: boolean; | ||
| warmupIterations?: number; | ||
| warmupTime?: number; | ||
| iterations?: number; | ||
| time?: number; | ||
| retainSamples?: boolean; | ||
| } | ||
|
|
||
| // Up to tinybench v5 the resolved options lived under `bench.opts`; from v6 they | ||
| // are flattened onto the bench instance itself. Returning the holder object | ||
| // (rather than a copy) keeps in-place mutation of `setup`/`teardown` working, | ||
| // which the walltime runner relies on to bracket its instrumentation window. | ||
| export function getBenchOptions(bench: Bench): ResolvedBenchOptions { | ||
| const opts = (bench as unknown as { opts?: ResolvedBenchOptions }).opts; | ||
| return opts ?? (bench as unknown as ResolvedBenchOptions); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.