xtuc / webassemblyjs

Toolchain for WebAssembly
https://webassembly.js.org
MIT License
779 stars 90 forks source link

Improves the utf8 decoder performance #1140

Closed Dig-Doug closed 1 year ago

Dig-Doug commented 1 year ago

When parsing large wasm files, the decode function is very slow. You can reproduce the performance issues with the information in https://github.com/webpack/webpack/issues/17044. This change refactors the recursive algorithm to an iterative version that should have the exact same behavior with significantly better performance.

xtuc commented 1 year ago

Thanks for the PR @Dig-Doug . For the record and since the CI is broken, the tests pass locally with your changes.

xtuc commented 1 year ago

Released in 1.11.6.