~+700% regression in wasm-opt --nm performance from Emscripten 3.1.38 -> 4.0.19
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- wasm
- 領域
- compilers, performance
調査の方向性
wasm-opt --nm のエントリポイントから始め、commit #6371 で導入された新しいテキストパーサーと以前のパーサーを比較してください。報告された .wast ファイルでリグレッションを再現し、リンクされているプロファイルを使って遅いパスを特定してください。新しいパーサーの動作を維持しながら、以前の約 ~11 秒に近いパフォーマンスを回復できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Previously we were using Emscripten 3.1.38.
In some of our code stripping related unit tests, we are running wasm-opt --nm on a .wast file. In old Emscripten 3.1.38, this step took ~11 seconds.
After updating to Emscripten 4.0.19, the same wasm-opt --nm step is now taking about 87 seconds, about ~8x increase from before.
Bisecting the issue, the performance regression has arrived in #6371:
commit 956d2d89d530012885c1f88c87bf8b872c187b70 (HEAD)
Author: Thomas Lively tlively@google.com
Date: Thu Apr 25 14:55:12 2024 -0700
[Parser] Enable the new text parser by default (#6371)
The new text parser is faster and more standards compliant than the old text
parser. Enable it by default in wasm-opt and update the tests to reflect the
slightly different results it produces. Besides following the spec, the new
parser differs from the old parser in that it:
- Does not synthesize `loop` and `try` labels unnecessarily
- Synthesizes different block names in some cases
- Parses exports in a different order
- Parses `nop`s instead of empty blocks for empty control flow arms
- Does not support parsing Poppy IR
- Produces different error messages
- Cannot parse `pop` except as the first instruction inside a `catch`
CC @tlively
A samply profile of the slow behavior can be observed https://share.firefox.dev/4aUcR0c
If I back out to the previous commit and profile that, then I get the following looking profile:
https://share.firefox.dev/4sc8owW
I wonder if there might exist any optimizations that could bring the performance of the new parser up to par with the old one?
- 主要言語
- WebAssembly
- スター
- 8.6k
- フォーク
- 885
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 70
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WebAssembly/binaryen のほかの issue
-
難易度 2/5 半日 初心者へのやさしさ 76/100
WebAssembly/binaryen#9018 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
WebAssembly/binaryen#9123 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
WebAssembly/binaryen#9122 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
WebAssembly/binaryen#9086 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
WebAssembly/binaryen#9038 · コメント 5 件 ·
WebAssembly/binaryen の issue をすべて見る
似ている issue
-
compiler/runtime
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
objectionary/eo#8869 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
EricSpencer00/Resilient#4824 · コメント 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
objectionary/jeo-maven-plugin#1758 ·
-
generics
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100