perf_counters
module · ferroui-base · v0.5.0
module perf_counters
Counters of the work the framework does per operation: how many property
changes are raised and how many of them anybody listens to, how many
styles are evaluated and how many match, how many resources are looked
up, how many bindings and text layouts are created. The performance
designs (docs/porting/performance/designs) each start by reading them.
An addition of the port (DEVIATIONS.md, Diagnostics): upstream has no
counterpart. The counters exist only with the feature perf-counters.
Without it perf_count! and
perf_count_virtual! expand to no code, the
functions of this module have empty bodies and
PerfCountersSnapshot has no size; no type of the framework gains a
field either way.
The counters are per thread (the thread of the dispatcher is the one that is measured), and counting changes no behaviour. Read them around the measured work:
let before = perf_counters::snapshot();
// ... the work ...
let counted = perf_counters::snapshot().since(&before);
println!("{}", counted.report_per(rows, "row"));
Contents
ENABLED— constantPerfCounter— enumcount— functionadd— functioncount_virtual_call— functionPerfCountersSnapshot— structsnapshot— functionreset— function
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.