aptos-core
aptos-core copied to clipboard
[Feature Request]Add timing metrics to VM to help diagnose where tuning work is needed
🚀 Feature Request
We need some idea of where the time is being spent in the VM.
Motivation
The bytecode validator has some obviously high-complexity code that could be improved, but is it worth spending any time (and risk) improving the algorithms used?
Possible approaches
- Offline profiling running on example blocks
- runtime metrics (see https://github.com/aptos-labs/aptos-core/blob/f49e8b1fe7c9b2b1c3352bb6d0e4eea2ee538d62/aptos-move/aptos-vm/src/move_vm_ext/warm_vm_cache.rs#L159)
- others?
Details
We should look at both (1) average-case and (2) outlier (e.g., top 10%/1%/max latency) behavior, as one represents $$ and the other represents poor user experience (and possibly poor gas attribution).
We may need to be careful about losing data from transactions aborted due to timeouts, as they may represent the real outlier problems.