Skip to content
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

Add a mechanism to "Transfer" JSObject between Workers #292

Merged
merged 19 commits into from
Mar 11, 2025

Conversation

kateinoigakukun
Copy link
Member

Close #289

These APIs allow transferring a `JSObject` between worker threads. The
`JSObject.transfer` method creates a `JSObject.Transferring` instance
that is `Sendable` and can be sent to another worker thread. The
`JSObject.receive` method requests the object from the source worker
thread and postMessage it to the destination worker thread.
Copy link

github-actions bot commented Mar 10, 2025

Time Change: +327ms (3%)

Total Time: 10,014ms

Test name Duration Change
Serialization/JavaScript function call through Wasm import with int 21ms -2ms (7%)
Serialization/JavaScript String to Swift String 3,852ms +207ms (5%) 🔍
View Unchanged
Test name Duration Change
Serialization/JavaScript function call through Wasm import 25ms -0ms
Serialization/JavaScript function call from Swift 125ms +1ms
Serialization/Swift Int to JavaScript with assignment 350ms +10ms (2%)
Serialization/Swift Int to JavaScript with call 1,010ms +32ms (3%)
Serialization/JavaScript Number to Swift Int 286ms +14ms (4%)
Serialization/Swift String to JavaScript with assignment 433ms +14ms (3%)
Serialization/Swift String to JavaScript with call 1,100ms +41ms (3%)
Object heap/Increment and decrement RC 2,798ms +11ms (0%)
View Baselines
Test name Duration
Serialization/Call JavaScript function directly 3ms
Serialization/Assign JavaScript number directly 2ms
Serialization/Call with JavaScript number directly 3ms
Serialization/Write JavaScript string directly 4ms
Serialization/Call with JavaScript string directly 3ms

@kateinoigakukun kateinoigakukun force-pushed the yt/transfer branch 2 times, most recently from af54f34 to 603e6c9 Compare March 11, 2025 09:44
@kateinoigakukun kateinoigakukun marked this pull request as ready for review March 11, 2025 10:08
@kateinoigakukun kateinoigakukun merged commit 26c3f30 into main Mar 11, 2025
7 checks passed
@kateinoigakukun kateinoigakukun deleted the yt/transfer branch March 11, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a mechanism to "Transfer" JSObject between Workers
1 participant