ref-fvm
ref-fvm copied to clipboard
Optimize actor performance
Performance is going to be pretty critical. We need to investigate things like:
- [ ] Trade-offs between "z", "s" and "3" optimization levels (for actors).
- [ ] Passing different optimization options to wasmtime.
- [ ] Enabling simd in wasmtime.
- [ ] Performing SHA256 hashing (used inside HAMTs) via a syscall instead of inside WASM.
- [ ] Actor optimizations (e.g., some cases could benefit from using btrees instead of hashmaps/sorting).
- [ ] Syscall overhead (does our syscall glue optimize out well?).
Method: Benchmark the conformance (testing/conformance) tests.
Pitfalls:
- Make sure the FVM itself is compiled in release mode.
- Make sure the wasm modules are pre-compiled (from WASM bytecode to native machine code) and cached. You may want to add a manual step in your tests to "warm" wasmtime's module cache.
VECTOR=test-vectors/corpus/specs_actors_v6/TestCronCatchedCCExpirationsAtDeadlineBoundary/c70afe9fa5e05990cac8ab8d4e49522919ad29e5be3f81ee4b59752c36c4a701-t0100-t0102-storageminer-6.json cargo test -- --nocapture --color=always (just keeping this here because useful)
It won't help with analyzing the internal wasm code, but https://github.com/flamegraph-rs/flamegraph may help in finding hotspots in the syscalls.
Hehe I’ve already started trying to wire this up- was hoping it might help with the wasm, was destined to figure that out the hard way… I’ll hunt down another wasm profiler, someone has to have built one.
On Fri, Jan 14, 2022 at 1:18 PM Steven Allen @.***> wrote:
It won't help with analyzing the internal wasm code, but https://github.com/flamegraph-rs/flamegraph may help in finding hotspots in the syscalls.
— Reply to this email directly, view it on GitHub https://github.com/filecoin-project/fvm/issues/265#issuecomment-1013390324, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDPMJCSPOTXRZ5FTFCQKWTUWBZHBANCNFSM5L54UMOQ . You are receiving this because you were assigned.Message ID: @.***>
@Stebalien I suspect you already analyzed these AIs:
Trade-offs between "z", "s" and "3" optimization levels (for actors). Passing different optimization options to wasmtime.
Mind posting your discoveries?
Trade-offs between "z", "s" and "3" optimization levels (for actors).
I haven't. Well, I tried, but it turns out that the wasm builder was ignoring our flags when I last tried.
@Stebalien which of these investigations are still pending? I think we should track the open ones as issues in builtin-actors.
There really isn't much use in tracking this.