swiftwasm / JavaScriptKit

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

Add a benchmark for property access using dynamic member lookup #254

Closed kateinoigakukun closed 3 months ago

kateinoigakukun commented 3 months ago

To see how much https://github.com/swiftwasm/JavaScriptKit/pull/253 will improve performance

github-actions[bot] commented 3 months ago

Time Change: +2,541ms (21%) 🚨

Total Time: 11,680ms

Test name Duration Change
Serialization/JavaScript function call through Wasm import 21ms +2ms (7%) 🔍
Serialization/JavaScript function call from Swift 99ms +5ms (5%) 🔍
Serialization/Swift Int to JavaScript with assignment 339ms +24ms (7%) 🔍
Serialization/Swift Int to JavaScript with call 967ms +50ms (5%) 🔍
Serialization/JavaScript Number to Swift Int 313ms +18ms (5%) 🔍
Serialization/Swift String to JavaScript with call 1,046ms +64ms (6%) 🔍
Serialization/JavaScript String to Swift String 3,790ms +268ms (7%) 🔍
Property access/Dynamic member lookup 2,014ms +2,014ms (100%) 🆘
View Unchanged | Test name | Duration | Change | | :--- | :---: | :---: | | Serialization/JavaScript function call through Wasm import with int | 14ms | -0ms | | Serialization/Swift String to JavaScript with assignment | 395ms | +15ms (3%) | | Object heap/Increment and decrement RC | 2,668ms | +80ms (3%) |
View Baselines | Test name | Duration | | :--- | :---: | | Serialization/Call JavaScript function directly | 3ms | | Serialization/Assign JavaScript number directly | 3ms | | Serialization/Call with JavaScript number directly | 3ms | | Serialization/Write JavaScript string directly | 2ms | | Serialization/Call with JavaScript string directly | 3ms |