swiftwasm / WasmKit

WebAssembly Runtime written in Swift
https://swiftpackageindex.com/swiftwasm/WasmKit/main/documentation/wasmkit
MIT License
226 stars 8 forks source link

WasmParser: Specialize more hot paths #153

Closed kateinoigakukun closed 1 week ago

kateinoigakukun commented 1 week ago

With this change, we can achieve 17% speedup on stringify macro benchmark. The performance number is same as the case with CMO but with smaller binary size.

baseline CMO this change
speed (ms) 198.1 172.8 169.9
size (kb) [^1] 1739 1923 1797

[^1]: swift-6.0.1-RELEASE, macOS 14.4.1 arm64

kkebo commented 1 week ago

Out of curiosity, what would happen if you combined this change with CMO?

kateinoigakukun commented 1 week ago

No speed up but it just adds code size

baseline CMO this change this change + CMO
speed (ms) 198.1 172.8 169.9 170.3
size (kb) 1739 1923 1797 1897
kkebo commented 1 week ago

Thanks!