diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-10-02 13:52:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-02 13:52:16 -0700 |
commit | 1f8d8a53e8fcee0791c11345fd7f328255cfa22c (patch) | |
tree | 2effc81da752bb71c486106bb5fe71e9e174389e /src/tools | |
parent | a9f91b9774d117a13c231ef0f40861372456878f (diff) | |
download | binaryen-1f8d8a53e8fcee0791c11345fd7f328255cfa22c.tar.gz binaryen-1f8d8a53e8fcee0791c11345fd7f328255cfa22c.tar.bz2 binaryen-1f8d8a53e8fcee0791c11345fd7f328255cfa22c.zip |
Fast validation (#1204)
This makes wasm validation parallel (the function part). This makes loading+validating tanks (a 12MB wasm file) 2.3x faster on a 4-core machine (from 3.5 to 1.5 seconds). It's a big speedup because most of loading+validating was actually validating.
It's also noticeable during compilation, since we validate by default at the end. 8% faster on -O2 and 23% on -O0. So actually fairly significant on -O0 builds.
As a bonus, this PR also moves the code from being 99% in the header to be 1% in the header.
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/wasm-reduce.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp index 355b70278..29484cc7a 100644 --- a/src/tools/wasm-reduce.cpp +++ b/src/tools/wasm-reduce.cpp @@ -414,9 +414,7 @@ struct Reducer : public WalkerPass<PostWalker<Reducer, UnifiedExpressionVisitor< } for (auto& func : functions) { curr->removeFunction(func.name); - WasmValidator validator; - validator.quiet = true; - if (validator.validate(*curr) && writeAndTestReduction()) { + if (WasmValidator().validate(*curr, false, true, true /* override quiet */) && writeAndTestReduction()) { std::cerr << "| removed function " << func.name << '\n'; noteReduction(); } else { |