Expand description
Allows profiling proving and verifying of Triton VM’s STARK proofs.
The profiler is used to measure the time taken by various parts of the proving and verifying process. It can be used to identify bottlenecks and optimize the performance of the STARK proof system.
The profiler is thread-local, meaning that each thread has its own profiler. This allows multiple threads to run in parallel without interfering with each other’s profiling data.
§Enabling Profiling
§In Dependencies
In release builds, profiling is disabled by default to allow for the fastest
possible proof generation & verification. To enable profiling, either make
sure that debug_assertions
is set, or add the following to your
Cargo.toml
:
[dependencies]
triton-vm = { version = "x.y.z", default-features = false }
§For Benchmarks
In order to enable profiling when running a benchmark, pass the flag
--no-default-features
to cargo bench
. In case this is not working in the
workspace directory, navigate to the crate’s directory and run the command
there.
§A note on the no_profile
feature design decision
The feature no_profile
disables profiling, and is enabled by default.
This seems backwards. However, it is an expression of how Triton VM favors
performance over profiling. Note how Cargo resolves dependencies:
if some dependency is transitively declared multiple times, the union of
all features will be enabled.
Imagine some dependency foo
enables a hypothetical do_profile
feature.
If another dependency bar
requires the most efficient proof generation,
it would be slowed down by foo
and could do nothing about it. Instead,
Disabling profiling by enabling the feature no_profile
allows bar
to dictate. This:
- makes the profile reports of
foo
disappear, which is sad, but - lets
bar
be fast, which is more important for Triton VM.
Structs§
Functions§
- Stop the current profiling session and generate a
VMPerformanceProfile
. If the profiler is disabled or not running, an emptyVMPerformanceProfile
is returned. - Start profiling. If the profiler is already running, this function cancels the current profiling session and starts a new one.