The dyno
application is a performance profiling and benchmarking tool for Fuel Orchestrator (forc).
It is designed to ensure that areas of the Fuel codebase are not regressing in performance, and can provide insight into the specifics of code performance. The tool is primarily designed to be used in a CI/CD pipeline, but can also be run in a headless state on a local machine.
The tool manages dispatching of forc
and measures performance frames at a fixed interval. Each frame is comprised of common hardware resource usage consumed by the running forc
executable at the time the frame was captured. The tool also takes cues from forc
to include extra information in the benchmarking frames (i.e: when certain compilation phases begin and end, generated binary information, etc), allowing for a more narrow and granular degree of inspection.
The tool can optionally use perf or sample
(Mac) for stats, inferno for flame graphs and hyperfine for additional sanity checks.
Important
The profiler requires the following:
- Rust Language
- Sway Language
- Sway Compiler
- Linux for
flamegraph
support usingperf
(Optional) - Hyperfine (Optional)
Postgres
for database support (Optional)
In order for perf
(used for flamegraph) to work properly on linux, the following options must be set in /etc/sysctl.conf
:
echo "kernel.perf_event_paranoid=-1" | sudo tee -a /etc/sysctl.conf
echo "kernel.kptr_restrict=0" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf
- Install Rust
- Instal Sway
- Install Hyperfine(Optional)
- Install Docker(Optional)
- Install Postgres(Optional)
Git clone the sway repository and build.
git clone https://github.com/FuelLabs/sway
cd sway
cargo build --release
Git clone the dyno repository.
git clone https://github.com/ourovoros-io/dyno.git
cd dyno
Run the tool by point to the forc
binary and a target folder.
cargo r --release -- -t <target_folder> -f <forc_profile_binary>
====================================================================================================
Welcome to the Fuel Dyno v0.1.0
====================================================================================================
Fuel Orchestrator Performance Profiling & Benchmarking
Usage: dyno [OPTIONS] --target <TARGET> --forc-path <FORC_PATH>
Options:
-t, --target <TARGET>
A path to a target folder or file to compile
-f, --forc-path <FORC_PATH>
The path to the forc binary
-o, --output-folder <OUTPUT_FOLDER>
[default: ./benchmarks]
-p, --print-output
Enable printing output (Optional)
--flamegraph
Flamegraph support (Optional)
--hyperfine
Enable hyperfine analysis (Optional)
--max-iterations <MAX_ITERATIONS>
Maximum iterations for hyperfine (Optional) [default: 2]
-d, --database
Database support (Optional)
-h, --help
Print help
-V, --version
Print version
The target
folder of items or item to be compiled by the Sway compiler
and profiled by dyno
.
Forc-path
option allows the usage of a specific version
of the compiler
that is modified.
Set the output folder for the benchmarks
data as json
.
By default the profiler will store the benchmarks under ./benchmarks
.
The format of the filenames is forc-version_md5-hash-of-forc_date_time
.
Provides a full print of all the stats generated by the comparison of two benchmark runs.
Tip
To get the most detailed output from the flamegraph in release mode we need to enable debug. We need to take under consideration that each flamegraph for each test target generated is about 3 MB.
[profile.release]
debug = true
Warning
Do not forget to remove this as it increases the size of the binary.
Example output
Enables hyperfine
feature.
Please follow the instruction in the DynoSite
README.md.