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 JSTypedArray.init(buffer:) initializer #314

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

kateinoigakukun
Copy link
Member

Without this initializer, the only way to create a TypedArray with a UnsafeBufferPointer was to convert it to an Array first and then create a new TypedArray from it.

Without this initializer, the only way to create a TypedArray with a
UnsafeBufferPointer was to convert it to an Array first and then create
a new TypedArray from it.
@kateinoigakukun kateinoigakukun marked this pull request as ready for review March 25, 2025 14:50
Copy link

Time Change: -34ms (0%)

Total Time: 9,527ms

Test name Duration Change
Serialization/JavaScript function call through Wasm import 23ms -3ms (11%) 👏
View Unchanged
Test name Duration Change
Serialization/JavaScript function call through Wasm import with int 23ms +1ms
Serialization/JavaScript function call from Swift 125ms +4ms (3%)
Serialization/Swift Int to JavaScript with assignment 327ms +5ms (1%)
Serialization/Swift Int to JavaScript with call 955ms +3ms (0%)
Serialization/JavaScript Number to Swift Int 262ms +2ms (0%)
Serialization/Swift String to JavaScript with assignment 407ms +3ms (0%)
Serialization/Swift String to JavaScript with call 1,034ms -3ms (0%)
Serialization/JavaScript String to Swift String 3,550ms -11ms (0%)
Object heap/Increment and decrement RC 2,788ms -35ms (1%)
View Baselines
Test name Duration
Serialization/Call JavaScript function directly 7ms
Serialization/Assign JavaScript number directly 8ms
Serialization/Call with JavaScript number directly 6ms
Serialization/Write JavaScript string directly 5ms
Serialization/Call with JavaScript string directly 6ms

@kateinoigakukun kateinoigakukun merged commit 620365b into main Mar 25, 2025
6 checks passed
@kateinoigakukun kateinoigakukun deleted the yt/typed-array-init branch March 25, 2025 14:59
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.

1 participant