swiftwasm / JavaScriptKit

Swift framework to interact with JavaScript through WebAssembly.
https://swiftpackageindex.com/swiftwasm/JavaScriptKit/main/documentation/javascriptkit
MIT License
693 stars 45 forks source link

Runtime Performance Optimization #207

Closed kateinoigakukun closed 2 years ago

kateinoigakukun commented 2 years ago
github-actions[bot] commented 2 years ago

Time Change: -3,602ms (19%) 👏

Total Time: 18,757ms

Test name Duration Change
Serialization/Call JavaScript function directly 4ms +1ms ⚠️
Serialization/Assign JavaScript number directly 5ms +2ms (37%) 🚨
Serialization/Call with JavaScript number directly 5ms -1ms 👏
Serialization/Write JavaScript string directly 4ms +2ms (37%) 🚨
Serialization/JavaScript function call from Swift 195ms -464ms (238%) 🏆
Serialization/Swift Int to JavaScript with call 1,536ms -1,056ms (68%) 🏆
Serialization/JavaScript Number to Swift Int 468ms -221ms (47%) 🎉
Serialization/Swift String to JavaScript with call 1,673ms -1,051ms (62%) 🏆
Object heap/Increment and decrement RC 7,844ms -512ms (6%)
View Unchanged | Test name | Duration | Change | | :--- | :---: | :---: | | Serialization/Call with JavaScript string directly | 3ms | -0ms | | Serialization/JavaScript function call through Wasm import | 25ms | +0ms | | Serialization/JavaScript function call through Wasm import with int | 20ms | +0ms | | Serialization/Swift Int to JavaScript with assignment | 421ms | -14ms (3%) | | Serialization/Swift String to JavaScript with assignment | 488ms | -15ms (3%) | | Serialization/JavaScript String to Swift String | 6,067ms | -272ms (4%) |