Skip to main content

Module instrument

Module instrument 

Source
Expand description

Lightweight instrumentation for profiling array parsing, expression parsing, and statement parsing.

This module provides zero-cost abstractions for profiling when the instrument feature is enabled. When disabled, all instrumentation macros and calls compile to nothing.

Structs§

InstrumentStats
Global instrumentation statistics

Functions§

get_stats
Get current statistics (snapshot)
record_arena_alloc
Record an arena.alloc call
record_arena_vec_allocation
Record an ArenaVec allocation with size info
record_arena_vec_empty
Record an empty ArenaVec that was allocated
record_arena_vec_waste
Record wasted capacity in ArenaVec (allocated but not used)
record_parse_array
Record array parsing started
record_parse_array_element
Record array element parsing started
record_parse_array_element_count
Record total array elements parsed
record_parse_array_element_with_arrow
Record array element with => operator
record_parse_array_simple_value
Record a simple/atomic value in an array (not followed by binary operators)
record_parse_atom
Record parse_atom call
record_parse_attribute
Record attribute group parsing
record_parse_class
Record a class/trait/interface declaration
record_parse_expr
Record a parse_expr call
record_parse_expr_array_first
Record first parse_expr call in array element (key or value)
record_parse_expr_array_second
Record second parse_expr call in array element (after =>)
record_parse_expr_bp_recursive
Record a recursive parse_expr_bp call (min_bp != 0)
record_parse_foreach
Record a foreach statement
record_parse_function
Record a function/method declaration
record_parse_if
Record if/elseif/else statements
record_parse_loop
Record for/while/do-while statements
record_parse_stmt
Record a statement parse call
record_parse_switch
Record switch statements
record_parse_try
Record try/catch/finally statements
report_stats
Print a formatted report of statistics
reset_stats
Reset all statistics