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

proposal: mechanism for using alternate backends #148

Closed
wants to merge 13 commits into from
Closed

Conversation

j-f1
Copy link
Member

@j-f1 j-f1 commented Jan 3, 2022

To use this API, first define a enum or struct conforming to JSBridge and define the required methods. Then, call JSObject.global(using: MyJSBridge.self) to get the global object.

Currently, JSTypedArray and JSBridgedClass only work with the default bridge, but I didn’t want to put too much effort into figuring out how to get those APIs to work properly if this approach didn’t end up getting accepted.

@github-actions
Copy link

github-actions bot commented Jan 3, 2022

Time Change: +641ms (7%) 🔍

Total Time: 8,761.25ms

Test name Duration Change
Serialization/Write JavaScript number directly 182.5ms +11.5ms (6%) 🔍
Serialization/Swift Int to JavaScript 2,716ms +186ms (6%) 🔍
Serialization/Swift String to JavaScript 2,737.5ms +141.5ms (5%) 🔍
Object heap/Increment and decrement RC 2,950.75ms +301.5ms (10%) ⚠️
ℹ️ View Unchanged
Test name Duration Change
Serialization/Write JavaScript string directly 174.5ms +0.5ms

performance-action

@j-f1
Copy link
Member Author

j-f1 commented Jan 3, 2022

So it looks like it is slower. That’s unfortunate.

@j-f1
Copy link
Member Author

j-f1 commented Jan 4, 2022

@kateinoigakukun’s proposal in discord is much better. Closing this for now.

@j-f1 j-f1 closed this Jan 4, 2022
@j-f1 j-f1 deleted the jed/jsbridge branch January 4, 2022 12:00
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.

None yet

1 participant