workerd icon indicating copy to clipboard operation
workerd copied to clipboard

add gc support to Rust owned objects

Open anonrig opened this issue 2 months ago • 3 comments

This PR adds garbage collection support to Rust-owned JSG resources, enabling proper cleanup when V8 collects JavaScript wrapper objects.

Implements Oilpan integration to our Rust/JSG integration. Compared to C++ GC implementation, Rust use cppgc heap for allocation of resources rather than kj::heap. We eventually need to do the same thing in our C++ implementation as well.


Used AI to help me write comments.

anonrig avatar Dec 03 '25 21:12 anonrig

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing yagiz/rust-gc (cc5611d) with main (dbe7e6f)

Summary

✅ 129 untouched benchmarks
⏩ 49 skipped benchmarks[^skipped]

[^skipped]: 49 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

codspeed-hq[bot] avatar Dec 03 '25 22:12 codspeed-hq[bot]

The generated output of @cloudflare/workers-types matches the snapshot in types/generated-snapshot :tada:

github-actions[bot] avatar Dec 12 '25 17:12 github-actions[bot]

I'm taking one step back and prepare an internal document to make the best decision.

anonrig avatar Dec 15 '25 22:12 anonrig