Comments (7)
Also, not to forget that web engines are rather special beasts, and the drawbacks of multiple tiers usually do not apply to non-web use cases.
from wabt.
Probably the best way to display these would be to list the opcodes and, for each of those, what opcodes they're followed by. Something along the lines of:
(local.get 1) 150
- (global.put 1) 50%
- (global.put 2) 30%
- ...
Probably better to avoid showing the matrix form of the markov chain. Those can get really big...
from wabt.
Out of curiosity, where does you claim come from that "inlining isn't actually helpful with wasm"?
As far as I know on the producer side in both llvm and binaryen we do a bunch of inlining and/or provide ways to increase of the decease the amount of inlining, and this has historically be valuable.
from wabt.
we believe this is the paper that argues inlining is considered harmful https://alan-romano.github.io/When_Function_Inlining_Meets_WebAssembly__Counterintuitive_Impacts_on_Runtime_Performance.pdf
we find inlining particularly harmful when targeting the JVM, because it has such tight restrictions on function size and whatnot. but that's (mostly) unrelated to performance. (except code size can prevent compilation, in particular the JVM JIT never kicks in for functions greater than 8kb in size.)
from wabt.
I see.. I've not seen that paper, thanks for the link.
The notable thing about targeting the JVM is that it itself will do a bunch of inlining, which I'm not sure that web engines do (or at least they maybe didn't historically).
from wabt.
It is true that on-stack replacement (OSR) is a serious known issue (see last paragraph in this section of the V8 docs), and so it is definitely possible to find benchmarks that regress by a lot without OSR, as the paper found. But often you find the opposite effect, because inlining is just so useful.
For comparison, the emscripten benchmark suite has cases that become many times slower without inlining. So we really cannot disable inlining in the toolchain.
Note that cases where OSR is needed are rare on the web, since you need to break up execution into short events anyhow (to avoid blocking the responsiveness of the browser). That gives a chance for lower-tiered code to be replaced. OSR may be more of an issue off the web; in those places, if you run code in one big execution then you do need to be aware of OSR, and you can work around it, e.g. by doing nodejs --no-liftoff
which disables tiering and goes straight into the fastest tier; other VMs have similar flags.
from wabt.
that makes sense, but:
we mean the whole motivation for adding things to wasm-stats (formerly opcodecnt) in the first place is because we wanna make wasm2kotlin work better, by introducing something like a wasm-deopt tool. like maybe this is ultimately useless for everyone else but we feel like deoptimization passes like "demacro" (aka "#define
s to functions") could be useful outside of just wasm2kotlin...
we also get to learn a bit about optimization passes (despite this being a deoptimizer) so that's cool.
from wabt.
Related Issues (20)
- Error using wasm2wat on a wasm file generated by Moonbit: "unexpected type form (got -0x30)" HOT 1
- Out-of-Memory Program Abort in wabt::interp::Table::Grow() HOT 2
- Out-of-Memory Program Abort in BinaryReaderInterp::OnDataCount()
- Invalid Memory Read in FreeList<wabt::interp::Object*>::IsUsed()
- error initializing module: invalid import "a.a" HOT 1
- Error while running testsuite (simd_lane, simd_load) "loop not vectorized" HOT 3
- wasm2wat: support component wasm HOT 1
- Wrong type error when validating globals with gc proposal features
- wat2wasm: Assertion `!"ParseExpr should only be called when IsExpr() is true"' failed in wabt::WastParser::ParseExpr
- Wast2Json fails on the testsuite HOT 8
- Library not loaded: /usr/local/opt/openssl@3/lib/libcrypto.3.dylib HOT 9
- Missing Import when running global.wast HOT 1
- `wast2json` miscompiles "if.wast" from the specification tests HOT 4
- Build failed on Apple Silicon platform HOT 4
- [wasm2c] Strange issue with double parsing in msvc HOT 5
- wasm2c compiling minimal example issues HOT 1
- [wasm2c] catching traps without exception runtime
- “picosha2.h”: No such file or directory HOT 2
- Allocator is out of memory in wasm-interp HOT 3
- Invalid Read Memory in wabt::interp HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wabt.