forked from google/pprof-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Add Bun runtime support with pure JavaScript backend #263
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
Open
SamuelLHuber
wants to merge
29
commits into
DataDog:main
Choose a base branch
from
SamuelLHuber:pyroscope-ts-bun-compat-2026-02-10
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,952
−69
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
5de4b4d
fix(bun): prevent native addon load crash with runtime-aware loader
SamuelLHuber 5e215be
feat(bun): add compatibility backend for time and heap profiles
SamuelLHuber fba473c
fix(bun): correct wall profile timing units and restart windows
SamuelLHuber 81fe333
ci: add bun runtime smoke test job
SamuelLHuber a6f856f
fix(build): use explicit parallel jobs for node-gyp
SamuelLHuber 35a456d
fix(install): build source installs when out/src is missing
SamuelLHuber 1e33f2b
fix(bun): make OOM monitor a no-op and add regression test
SamuelLHuber 711b8ea
fix(install): compile missing TS artifacts on source installs
SamuelLHuber 91ae493
ci: enforce bun smoke as merge and publish gate
SamuelLHuber 15f3833
fix(bun): preserve wall label transitions and cpu metadata
SamuelLHuber 0c7141d
test(bun): smoke-test packed install artifact
SamuelLHuber c31ad24
fix(bun): make context dedupe bigint-safe and stable
SamuelLHuber 2cafd51
fix(bun): canonicalize nested context signatures for dedupe
SamuelLHuber 8c226c2
fix(packaging): include built addon in git installs
SamuelLHuber 5ed2853
fix(bun): preserve sub-ms context timestamp precision
SamuelLHuber 4a7dc56
fix(heap): make start idempotent for matching params
SamuelLHuber 01c8cb5
fix(bun): make heap start idempotent for equivalent config
SamuelLHuber dc1c0e8
ci(release): gate publish on bun smoke checks
SamuelLHuber 270bb6b
fix(bun): resolve pprof-format safely in commonjs runtime
SamuelLHuber 5e0f4f4
perf(bun): cache context signatures in timeline normalization
SamuelLHuber 151931e
test(cped): stabilize freelist trim regression under instrumentation
SamuelLHuber 1eb1464
test(cped): stabilize freelist plateau regression under coverage
SamuelLHuber 4db7fb4
ci(bun): run smoke gates on linux and darwin triplets
SamuelLHuber a7aa1a3
fix(bun): preserve worker thread identity in thread id
SamuelLHuber 333e6c7
fix(loader): fall back to local build artifact when binding resolutio…
SamuelLHuber d7c88a3
test: stabilize nyc when os.cpus() is empty
SamuelLHuber 31f75e6
fix(runtime): harden bun detection fallback
SamuelLHuber be0a9fd
fix(bun): preserve cpu-time when filtering short context flips
SamuelLHuber 6c0669c
Track out/src artifacts for git dependency installs
SamuelLHuber 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,40 @@ | ||
| /** | ||
| * Copyright 2026 Datadog | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| */ | ||
| import { AllocationProfileNode, TimeProfile, TimeProfilerMetrics } from './v8-types'; | ||
| export declare class BunTimeProfiler { | ||
| metrics: TimeProfilerMetrics; | ||
| state: { | ||
| [key: string]: number; | ||
| }; | ||
| private readonly withContexts; | ||
| private readonly intervalMicros; | ||
| private readonly collectCpuTime; | ||
| private started; | ||
| private startTime; | ||
| private contextTimeline; | ||
| private currentContext; | ||
| private currentContextSignature; | ||
| private lastRecordedContextSignature; | ||
| private lastContextCpuUsage; | ||
| constructor(...args: unknown[]); | ||
| get context(): object | undefined; | ||
| set context(context: object | undefined); | ||
| private recordContext; | ||
| private normalizedContextTimeline; | ||
| start(): void; | ||
| stop(restart: boolean): TimeProfile; | ||
| dispose(): void; | ||
| v8ProfilerStuckEventLoopDetected(): number; | ||
| } | ||
| export declare function bunGetNativeThreadId(): number; | ||
| export declare function bunStartSamplingHeapProfiler(): void; | ||
| export declare function bunStopSamplingHeapProfiler(): void; | ||
| export declare function bunGetAllocationProfile(): AllocationProfileNode; | ||
| export declare function bunMonitorOutOfMemory(_heapLimitExtensionSize: number, _maxHeapLimitExtensionCount: number, _dumpHeapProfileOnSdterr: boolean, _exportCommand: Array<String> | undefined, _callback: unknown, _callbackMode: number, _isMainThread: boolean): void; |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? You also included all of
out/src– which are generated code – into this PR.