Comments (3)
Depends on new wasmparser
updates:
- bytecodealliance/wasm-tools#1495 (mandatory)
- bytecodealliance/wasm-tools#1496 (optional)
from wasmi.
Using the following definitions for Wasmi's code_map.rs
:
pub struct UncompiledFuncEntity {
func_index: u32,
bytes: SmallByteSlice,
module: ModuleHeader,
validate: Option<wasmparser::ValidatorResources>,
}
pub enum SmallByteSlice {
Small {
len: u8,
bytes: [u8; 22],
},
Big(Box<[u8]>),
}
SmallByteSlice
now stores 22 bytes inline instead of 30.- Note: With
union
andunsafe
Rust trickery we could decrease the size of this type by another 8 bytes, however, for now I don't think the gains are worth this refactor.
- Note: With
- Replaced
func_to_validate: Option<wasmparser::FuncToValidate<wasmparser::ValidatorResources>>
field withvalidate: Option<wasmparser::ValidatorResources>
which is a lot smaller. Theindex
andty
fields are redundantly stored inUncompiledFuncEntity::func_index
field with access tomodule
if we do some refactoring inModuleHeader
. Furthermore thefeatures: WasmFeatures
field is the same for all uncompiled function entities in the sameEngine
and thus can be stored in theCodeMap
directly and reused.
All in all this nets us the following improvements in memory consumption:
size_of<UncompiledFuncEntity>()
: 88 -> 48size_of<InternalFuncEntity>()
: 88 -> 48
Therefore, 40 bytes savings per function processed by the Engine
.
For 1000 functions this is equivalent to 40kB.
from wasmi.
Blocked by bytecodealliance/wasm-tools#1493 and bytecodealliance/wasmtime#8341 (comment).
from wasmi.
Related Issues (20)
- Implement the Wasm `component-model` proposal HOT 2
- CI: Run Wasm spec testsuite with `miri`
- Big performance regression between 0.31 and 0.32 HOT 7
- Optimization: Special handling for common shadow stack instruction sequences HOT 1
- Create C bindings for Wasmi
- Simplification: Rewrite `iNN.sub` with immediate to new `iNN.add` variant
- Restore CI benchmarks HOT 1
- Wasmi versions `0.32.0-beta.6` cannot run `ffmpeg.wasm` correctly HOT 20
- Update `wasmi_wasi` WASI implementing dependencies HOT 1
- Optimization: Fuse transitive copies HOT 1
- Add `--verbose` mode to Wasmi CLI HOT 2
- Add support for fully hibernate-able Wasm instances HOT 7
- Handle host function calls the same as other instructions in the Wasmi executor HOT 1
- Make it possible to debug and pretty print Wasmi bytecode
- Add Wasmi execution profiling HOT 1
- The URL in the project description is 404 HOT 1
- Optimize `Linker` setup
- Add customizable `wasmi::Engine` limits
- Reconsider proper fuel charging for lazily compiled functions
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 wasmi.