3 Profiling Rival
Rival’s compiler and evaluator expose a variety of interesting profiling data, which can be accessed via the rival-profile function. Note that all of Rival’s profiling information is not guaranteed to be stable, backward-, or forward-compatible between versions. We do not recommend relying on rival-profile in your code without following Rival development closely.
The currently-supported command symbols and their return values are:
instructions returns the number of register machine instructions in the compiled machine.
iterations returns the number of re-evaluation iterations needed for the most recent call to rival-apply with the compiled machine. This should be a number from 0 to *rival-max-iterations*, inclusive.
bumps returns the number of unexpected non-convergences detected during the most recent call to rival-apply with the compiled machine. These generally represent internal errors in Rival. While Rival will attempt to handle these "bumps" smoothly, they should still be reported to the developers as a bug.
executions returns a list of "execution" structs, one for every register machine instruction executed by Rival. These executions are stored in a fixed-size buffer (see *rival-profile-executions*) which is retained across rival-apply calls and can fill up. The buffer is emptied by calls to (rival-profile machine 'executions), so make sure to call this function regularly. If the list of "execution"s returned by rival-profile is equal in length to *rival-profile-executions*, you likely filled the buffer and are missing some executions.
struct
(struct execution (name number precision time))
name : symbol? number : natural? precision : natural? time : flonum?
parameter
(*rival-profile-executions* executions) → void? executions : natural?
= 1000