-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Reduce QueuedTask size from 56 to 48 bytes
#25748
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
base: main
Are you sure you want to change the base?
Conversation
- Remove performMicrotaskFunction argument from BunPerformMicrotaskJob - Async context is now handled directly in JSMicrotask.cpp - Update queueMicrotaskJob to use 4 arguments instead of 5
|
Updated 11:36 PM PT - Dec 29th, 2025
❌ @sosukesuzuki, your commit 47b77ef has 2 failures in
🧪 To try this PR locally: bunx bun-pr 25748That installs a local version of the PR into your bun-25748 --bun |
|
@Jarred-Sumner Could you review oven-sh/WebKit#123 and this? If you approve oven-sh/WebKit#123, I'll merge it and I'll update the |
WalkthroughIntroduces new microtask benchmark scripts and refactors the microtask queuing mechanism in C++ bindings. Three benchmark files measure microtask memory and throughput characteristics. The microtask job invocation is simplified by removing separate microtask function retrieval and passing the job directly with asyncContext. WebKit version reference updated in CMake configuration. Changes
Possibly related PRs
Suggested reviewers
Pre-merge checks✅ Passed checks (2 passed)
Comment |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (6)
bench/snippets/microtask-memory.mjsbench/snippets/microtask-throughput.mjsbench/snippets/queued-task-size.mjscmake/tools/SetupWebKit.cmakesrc/bun.js/bindings/ZigGlobalObject.cppsrc/bun.js/bindings/bindings.cpp
🧰 Additional context used
📓 Path-based instructions (1)
src/bun.js/bindings/**/*.cpp
📄 CodeRabbit inference engine (CLAUDE.md)
src/bun.js/bindings/**/*.cpp: Create classes in three parts in C++ when there is a public constructor: Foo (JSDestructibleObject), FooPrototype (JSNonFinalObject), and FooConstructor (InternalFunction)
Define properties using HashTableValue arrays in C++ JavaScript class bindings
Add iso subspaces for C++ classes with fields in JavaScript class bindings
Cache structures in ZigGlobalObject for JavaScript class bindings
Files:
src/bun.js/bindings/ZigGlobalObject.cppsrc/bun.js/bindings/bindings.cpp
🧠 Learnings (27)
📓 Common learnings
Learnt from: Jarred-Sumner
Repo: oven-sh/bun PR: 25429
File: src/bun.js/bindings/helpers.h:422-422
Timestamp: 2025-12-23T06:50:41.142Z
Learning: In Bun's C++ bindings (src/bun.js/bindings/helpers.h and similar files), when returning an empty JSC::Identifier and a VM is accessible, prefer using `vm.propertyNames->emptyIdentifier` over constructing with `JSC::Identifier(JSC::Identifier::EmptyIdentifierFlag::EmptyIdentifier)`. The cached identifier from the VM's property names table is more efficient and consistent with WebKit upgrade patterns.
📚 Learning: 2025-11-24T18:36:59.706Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/bun.js/bindings/v8/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:59.706Z
Learning: Applies to src/bun.js/bindings/v8/test/v8/v8.test.ts : Add corresponding test cases to test/v8/v8.test.ts using checkSameOutput() function to compare Node.js and Bun output
Applied to files:
bench/snippets/microtask-memory.mjsbench/snippets/queued-task-size.mjsbench/snippets/microtask-throughput.mjssrc/bun.js/bindings/ZigGlobalObject.cppsrc/bun.js/bindings/bindings.cpp
📚 Learning: 2025-11-24T18:37:30.259Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: test/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:37:30.259Z
Learning: Applies to test/**/*.test.{ts,js,jsx,tsx,mjs,cjs} : Use `Buffer.alloc(count, fill).toString()` instead of `'A'.repeat(count)` to create repetitive strings in tests, as ''.repeat is very slow in debug JavaScriptCore builds
Applied to files:
bench/snippets/microtask-memory.mjsbench/snippets/queued-task-size.mjsbench/snippets/microtask-throughput.mjs
📚 Learning: 2025-10-14T04:04:47.894Z
Learnt from: Jarred-Sumner
Repo: oven-sh/bun PR: 23636
File: src/shell/ParsedShellScript.zig:15-0
Timestamp: 2025-10-14T04:04:47.894Z
Learning: In src/shell/ParsedShellScript.zig, the JavaScript garbage collector's memory reporting API only allows reporting extra memory allocation once at object creation time. Therefore, `estimated_size_for_gc` is intentionally set once during initialization (via `#computeEstimatedSizeForGC()`) and not updated afterward, even though fields like `args`, `export_env`, and `cwd` may be mutated by methods like `setCwd()`, `setEnv()`, and `take()`. The `estimatedSize()` method returns this cached initial value, while `memoryCost()` computes the size on-demand.
Applied to files:
bench/snippets/microtask-memory.mjsbench/snippets/queued-task-size.mjs
📚 Learning: 2025-10-14T04:04:17.132Z
Learnt from: Jarred-Sumner
Repo: oven-sh/bun PR: 23636
File: src/shell/interpreter.zig:672-0
Timestamp: 2025-10-14T04:04:17.132Z
Learning: In Bun's shell interpreter (src/shell/interpreter.zig), the JavaScript garbage collector's memory reporting API only allows reporting extra memory allocation once at object creation time. Therefore, `estimated_size_for_gc` is intentionally set once during initialization and not updated afterward, even though fields like `root_io`, `vm_args_utf8`, and `export_env` may be mutated later. The `estimatedSize()` method returns this cached initial value, while `memoryCost()` computes the size on-demand.
Applied to files:
bench/snippets/microtask-memory.mjsbench/snippets/queued-task-size.mjs
📚 Learning: 2025-11-24T18:37:30.259Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: test/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:37:30.259Z
Learning: Applies to test/**/*.test.{ts,js,jsx,tsx,mjs,cjs} : Prefer async/await over callbacks in tests
Applied to files:
bench/snippets/microtask-throughput.mjs
📚 Learning: 2025-11-24T18:37:30.259Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: test/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:37:30.259Z
Learning: Applies to test/**/*.test.{ts,js,jsx,tsx,mjs,cjs} : Prefer concurrent tests over sequential tests using `test.concurrent` or `describe.concurrent` when multiple tests spawn processes or write files, unless it's very difficult to make them concurrent
Applied to files:
bench/snippets/microtask-throughput.mjs
📚 Learning: 2025-11-24T18:37:30.259Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: test/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:37:30.259Z
Learning: Applies to test/**/*.test.{ts,js,jsx,tsx,mjs,cjs} : Always use `await using` or `using` to ensure proper resource cleanup in tests for APIs like Bun.listen, Bun.connect, Bun.spawn, Bun.serve, etc
Applied to files:
bench/snippets/microtask-throughput.mjs
📚 Learning: 2025-12-16T00:21:32.179Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-16T00:21:32.179Z
Learning: Applies to src/bun.js/bindings/**/*.cpp : Cache structures in ZigGlobalObject for JavaScript class bindings
Applied to files:
src/bun.js/bindings/ZigGlobalObject.cpp
📚 Learning: 2025-11-24T18:37:47.899Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/bun.js/bindings/v8/AGENTS.md:0-0
Timestamp: 2025-11-24T18:37:47.899Z
Learning: Applies to src/bun.js/bindings/v8/**/<UNKNOWN> : <UNKNOWN>
Applied to files:
src/bun.js/bindings/ZigGlobalObject.cppsrc/bun.js/bindings/bindings.cpp
📚 Learning: 2025-11-24T18:36:59.706Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/bun.js/bindings/v8/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:59.706Z
Learning: Applies to src/bun.js/bindings/v8/src/napi/napi.zig : For each new V8 C++ method, add both GCC/Clang and MSVC mangled symbol names to the V8API struct in src/napi/napi.zig using extern fn declarations
Applied to files:
src/bun.js/bindings/ZigGlobalObject.cpp
📚 Learning: 2025-11-24T18:36:59.706Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/bun.js/bindings/v8/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:59.706Z
Learning: Applies to src/bun.js/bindings/v8/V8*.h : Add BUN_EXPORT visibility attribute to all public V8 API functions to ensure proper symbol export across platforms
Applied to files:
src/bun.js/bindings/ZigGlobalObject.cppsrc/bun.js/bindings/bindings.cpp
📚 Learning: 2025-12-16T00:21:32.179Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-16T00:21:32.179Z
Learning: Applies to src/bun.js/bindings/**/*.cpp : Add iso subspaces for C++ classes with fields in JavaScript class bindings
Applied to files:
src/bun.js/bindings/ZigGlobalObject.cppsrc/bun.js/bindings/bindings.cpp
📚 Learning: 2025-11-24T18:36:59.706Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/bun.js/bindings/v8/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:59.706Z
Learning: Applies to src/bun.js/bindings/v8/src/symbols.txt : Add symbol names without leading underscore to src/symbols.txt for each new V8 API method
Applied to files:
src/bun.js/bindings/ZigGlobalObject.cppsrc/bun.js/bindings/bindings.cpp
📚 Learning: 2025-12-16T00:21:32.179Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-16T00:21:32.179Z
Learning: Applies to src/bun.js/bindings/**/*.cpp : Create classes in three parts in C++ when there is a public constructor: Foo (JSDestructibleObject), FooPrototype (JSNonFinalObject), and FooConstructor (InternalFunction)
Applied to files:
src/bun.js/bindings/ZigGlobalObject.cppsrc/bun.js/bindings/bindings.cpp
📚 Learning: 2025-11-24T18:36:59.706Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/bun.js/bindings/v8/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:59.706Z
Learning: Applies to src/bun.js/bindings/v8/src/symbols.dyn : Add symbol names with leading underscore and semicolons in braces to src/symbols.dyn for each new V8 API method
Applied to files:
src/bun.js/bindings/ZigGlobalObject.cpp
📚 Learning: 2025-12-23T06:50:41.142Z
Learnt from: Jarred-Sumner
Repo: oven-sh/bun PR: 25429
File: src/bun.js/bindings/helpers.h:422-422
Timestamp: 2025-12-23T06:50:41.142Z
Learning: In Bun's C++ bindings (src/bun.js/bindings/helpers.h and similar files), when returning an empty JSC::Identifier and a VM is accessible, prefer using `vm.propertyNames->emptyIdentifier` over constructing with `JSC::Identifier(JSC::Identifier::EmptyIdentifierFlag::EmptyIdentifier)`. The cached identifier from the VM's property names table is more efficient and consistent with WebKit upgrade patterns.
Applied to files:
src/bun.js/bindings/ZigGlobalObject.cpp
📚 Learning: 2025-11-24T18:36:59.706Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/bun.js/bindings/v8/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:59.706Z
Learning: Applies to src/bun.js/bindings/v8/test/v8/v8-module/main.cpp : Create test functions in test/v8/v8-module/main.cpp that take FunctionCallbackInfo<Value> parameter, use the test V8 API, print results for comparison with Node.js, and return Undefined
Applied to files:
src/bun.js/bindings/ZigGlobalObject.cppsrc/bun.js/bindings/bindings.cpp
📚 Learning: 2025-11-24T18:36:59.706Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/bun.js/bindings/v8/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:59.706Z
Learning: Applies to src/bun.js/bindings/v8/V8*.cpp : Create V8 class implementations with .cpp extension following the pattern V8ClassName.cpp that include the header, v8_compatibility_assertions.h, use ASSERT_V8_TYPE_LAYOUT_MATCHES macro, and implement methods using isolate->currentHandleScope()->createLocal<T>() for handle creation
Applied to files:
src/bun.js/bindings/bindings.cpp
📚 Learning: 2025-11-24T18:36:59.706Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/bun.js/bindings/v8/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:59.706Z
Learning: Applies to src/bun.js/bindings/v8/V8*.cpp : Use JSC::WriteBarrier for heap-allocated references in V8 objects and implement visitChildren() for custom heap objects to support garbage collection
Applied to files:
src/bun.js/bindings/bindings.cpp
📚 Learning: 2025-10-01T21:59:54.571Z
Learnt from: taylordotfish
Repo: oven-sh/bun PR: 23169
File: src/bun.js/bindings/webcore/JSDOMConvertEnumeration.h:47-74
Timestamp: 2025-10-01T21:59:54.571Z
Learning: In the new bindings generator (bindgenv2) for `src/bun.js/bindings/webcore/JSDOMConvertEnumeration.h`, the context-aware enumeration conversion overloads intentionally use stricter validation (requiring `value.isString()` without ToString coercion), diverging from Web IDL semantics. This is a design decision documented in comments.
Applied to files:
src/bun.js/bindings/bindings.cpp
📚 Learning: 2025-09-19T19:55:22.427Z
Learnt from: markovejnovic
Repo: oven-sh/bun PR: 22568
File: src/valkey/js_valkey_functions.zig:853-854
Timestamp: 2025-09-19T19:55:22.427Z
Learning: In Bun's JSPromise API, `resolvedPromiseValue(globalThis: *JSGlobalObject, value: JSValue) JSValue` returns a JSValue directly (not a JSPromise that needs `.toJS()` called on it). This is different from `resolvedPromise()` which returns a *JSPromise that would need `.toJS()`.
Applied to files:
src/bun.js/bindings/bindings.cpp
📚 Learning: 2025-09-05T19:48:44.481Z
Learnt from: markovejnovic
Repo: oven-sh/bun PR: 21728
File: src/valkey/valkey.zig:0-0
Timestamp: 2025-09-05T19:48:44.481Z
Learning: In ValkeyCommand.Promise, when you need to resolve with already-converted JSValues (not RESPValues), use promise_ptr.promise.resolve() to bypass the RESP-to-JS conversion wrapper. The ValkeyCommand.Promise.resolve() method is for converting RESPValues, while direct .promise access is for pre-converted JSValues.
Applied to files:
src/bun.js/bindings/bindings.cpp
📚 Learning: 2025-09-05T19:48:44.481Z
Learnt from: markovejnovic
Repo: oven-sh/bun PR: 21728
File: src/valkey/valkey.zig:0-0
Timestamp: 2025-09-05T19:48:44.481Z
Learning: In ValkeyCommand.zig, the Promise type is a wrapper that encapsulates valkey-specific behavior. The actual underlying promise is accessed via the `.promise` field, so the correct pattern is `promise_ptr.promise.resolve(...)` not `promise_ptr.resolve(...)`.
Applied to files:
src/bun.js/bindings/bindings.cpp
📚 Learning: 2025-09-05T19:49:26.188Z
Learnt from: markovejnovic
Repo: oven-sh/bun PR: 21728
File: src/valkey/js_valkey_functions.zig:852-867
Timestamp: 2025-09-05T19:49:26.188Z
Learning: In Bun's Zig codebase, `.js_undefined` is a valid way to represent JavaScript's undefined value when working with JSPromise.resolve() and similar JavaScript interop functions. This is the correct pattern to use rather than `jsc.JSValue.jsUndefined()`.
Applied to files:
src/bun.js/bindings/bindings.cpp
📚 Learning: 2025-09-05T19:49:26.188Z
Learnt from: markovejnovic
Repo: oven-sh/bun PR: 21728
File: src/valkey/js_valkey_functions.zig:852-867
Timestamp: 2025-09-05T19:49:26.188Z
Learning: In Bun’s Zig code, `.js_undefined` is a valid and preferred JSValue literal for “undefined” (e.g., resolving JSPromise). Do not refactor usages to `jsc.JSValue.jsUndefined()`, especially in src/valkey/js_valkey_functions.zig unsubscribe().
Applied to files:
src/bun.js/bindings/bindings.cpp
📚 Learning: 2025-11-24T18:36:59.706Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/bun.js/bindings/v8/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:59.706Z
Learning: Applies to src/bun.js/bindings/v8/V8*.cpp : Use localToJSValue() to convert V8 handles to JSC values and perform JSC operations within V8 method implementations
Applied to files:
src/bun.js/bindings/bindings.cpp
🧬 Code graph analysis (3)
bench/snippets/microtask-memory.mjs (2)
bench/snippets/queued-task-size.mjs (4)
gc(6-8)completed(18-18)i(26-26)i(62-62)bench/snippets/microtask-throughput.mjs (10)
completed(8-8)completed(29-29)i(10-10)i(21-21)i(32-32)i(55-55)i(64-64)p(20-20)promises(54-54)promises(63-63)
bench/snippets/queued-task-size.mjs (1)
bench/snippets/microtask-memory.mjs (9)
gc(10-16)resolveAll(39-39)allDone(40-42)startTime(45-45)startTime(89-89)startTime(123-123)i(48-48)i(93-93)i(126-126)
src/bun.js/bindings/ZigGlobalObject.cpp (2)
src/bun.js/bindings/ZigGlobalObject.h (1)
globalObject(131-131)src/bun.js/bindings/ScriptExecutionContext.cpp (2)
globalObject(93-96)globalObject(93-93)
🪛 Biome (2.1.2)
bench/snippets/microtask-memory.mjs
[error] 128-128: Do not add then to an object.
(lint/suspicious/noThenProperty)
bench/snippets/microtask-throughput.mjs
[error] 67-67: Do not add then to an object.
(lint/suspicious/noThenProperty)
🔇 Additional comments (6)
cmake/tools/SetupWebKit.cmake (1)
5-5: WebKit release artifact does not exist at the constructed URL.The WEBKIT_VERSION update to
preview-pr-123-bc52e8a3results in a broken download URL. The build will fail at the file download stage (line 93) with a 404 error. Verify that:
- The release tag
autobuild-preview-pr-123-bc52e8a3exists in the oven-sh/WebKit repository and artifacts have been published.- If this is a preview/in-progress build, ensure artifacts are publicly available before merging.
⛔ Skipped due to learnings
Learnt from: cirospaciari Repo: oven-sh/bun PR: 24607 File: packages/bun-usockets/src/crypto/root_certs.h:3589-3618 Timestamp: 2025-11-11T22:08:38.015Z Learning: For PRs that update certificate data (e.g., packages/bun-usockets/src/crypto/root_certs.h or packages/bun-usockets/certdata.txt), treat these files as generated artifacts and avoid review comments unless there is a clear build/runtime breakage.bench/snippets/microtask-throughput.mjs (1)
62-74: Biome warning is a false positive.The
thenproperty is intentionally added to test thenable resolution viaPromiseResolveThenableJob. This is a valid benchmark pattern for measuring the performance of promise-like object resolution.bench/snippets/microtask-memory.mjs (1)
116-151: Biome warning is a false positive.The
thenproperty at line 128 is intentionally added to test thenable memory overhead viaPromiseResolveThenableJob. This is the same pattern as in microtask-throughput.mjs and is a valid benchmark use case.src/bun.js/bindings/ZigGlobalObject.cpp (1)
1070-1073: LGTM! Microtask queuing correctly updated to match the signature.The new QueuedTask construction at lines 1070-1073 properly implements the BunPerformMicrotaskJob signature:
- Callback is validated as a function (line 1057)
- Empty asyncContext is converted to jsUndefined() (lines 1066-1068)
- Parameters match the documented signature: job, asyncContext, arg0 (optional), arg1 (optional)
All BunPerformMicrotaskJob call sites in the codebase have been updated consistently with this variadic parameter pattern:
- ZigGlobalObject.cpp:1072 (2 args: callback, asyncContext)
- bindings.cpp:3542 (4 args: rejectPromiseFunction, asyncContext, promise, value)
- bindings.cpp:5429 (4 args via microtaskArgs array)
src/bun.js/bindings/bindings.cpp (2)
5408-5430: Consistent implementation of simplified microtask queuingThe changes here correctly mirror the pattern from
JSC__JSPromise__rejectOnNextTickWithHandled: the job is passed directly as the first argument toBunPerformMicrotaskJob, eliminating the separate microtask function parameter. The assertions (lines 5410-5427) properly validate that the job is either anAsyncContextFrameor callable.The argument layout is well-documented and consistent:
microtaskArgs[0]= jobmicrotaskArgs[1]= asyncContextmicrotaskArgs[2]= arg0microtaskArgs[3]= arg1
3540-3545: Code structure is consistent across all microtask queuing call sites.The QueuedTask construction pattern with
nullptr,BunPerformMicrotaskJob, globalObject, followed by variable arguments (2 or 4 args as needed) is properly implemented. The optional nature of arg0 and arg1 is correctly documented in comments.The three call sites are all consistent:
functionQueueMicrotask(ZigGlobalObject.cpp): 2 args (callback, asyncContext)JSC__JSPromise__rejectOnNextTickWithHandled(bindings.cpp:3542): 4 args (rejectPromiseFunction, asyncContext, promise, value)JSC__JSGlobalObject__queueMicrotaskJob(bindings.cpp:5429): 4 args (microtaskArgs[0-3])Assertions properly validate that the job is either an AsyncContextFrame or callable. Defensive handling of empty asyncContext and value arguments is correct.
| const gc = () => { | ||
| if (typeof Bun !== "undefined") { | ||
| Bun.gc(true); | ||
| } else if (typeof global !== "undefined" && global.gc) { | ||
| global.gc(); | ||
| } | ||
| }; |
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.
🧹 Nitpick | 🔵 Trivial
Consider standardizing GC helper across benchmark files.
This file's GC helper supports both Bun and Node.js (global.gc), but queued-task-size.mjs only checks for Bun.gc. For consistency and cross-runtime compatibility, consider using this more robust pattern in all benchmark files.
Example: Apply to queued-task-size.mjs
const gc = () => {
- if (typeof Bun !== "undefined") Bun.gc(true);
+ if (typeof Bun !== "undefined") {
+ Bun.gc(true);
+ } else if (typeof global !== "undefined" && global.gc) {
+ global.gc();
+ }
};Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In bench/snippets/microtask-memory.mjs around lines 10-16 the GC helper handles
Bun and Node (global.gc); standardize other benchmark files to this pattern by
updating queued-task-size.mjs (and any other files using Bun.gc only) to use a
helper that first checks for typeof Bun !== "undefined" and calls Bun.gc(true),
then falls back to typeof global !== "undefined" && global.gc() and calls
global.gc(); ideally extract this into a small shared util (e.g.,
bench/utils/gc.mjs) and import it in affected benchmark files so all benchmarks
use the same cross-runtime GC helper.
What does this PR do?
oven-sh/WebKit#123 tries to reduce
QueuedTasksize. This PR addresses it from Bun side.How did you verify your code works?
Existing tests. And performance evaluation is here