REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
profile.hpp File Reference

Optional route-attribution counters — the profiling substrate. More...

#include <cstdint>
#include <type_traits>
#include "real/core/config.hpp"
Include dependency graph for profile.hpp:

Namespaces

namespace  real
 REAL's public API: real::regex, real::static_regex, real::flags and the match/iterator types built on them.
 
namespace  real::detail
 DFA construction internals: subset construction over a flattened NFA. Not a stable API.
 
namespace  real::detail::prof
 Opt-in route/work counters, compiled out unless the profiling build flag is set.
 

Enumerations

enum class  real::detail::prof::route : std::uint8_t {
  class_loop = 0 , cp_class_loop , exact_literal , inner_literal ,
  fixed_shape , real::detail::prof::fixed_shape_pair , codepoint_class , alternation ,
  real::detail::prof::aho_corasick , onepass_full , onepass_window , real::detail::prof::run_shape_window ,
  real::detail::prof::lazy_dfa_anchored , real::detail::prof::lazy_dfa_fwd_rev , general_full , general_window ,
  trailing_la , real::detail::prof::possessive_byte_loop , real::detail::prof::possessive_class_loop , real::detail::prof::possessive_cp_class_loop ,
  real::detail::prof::possessive_delimited , count_
}
 Named once-per-dispatch routes. Always visible so tick call sites compile OFF. More...
 
enum class  real::detail::prof::event : std::uint8_t {
  first_byte_skip = 0 , cascade , rare_byte , memmem ,
  real::detail::prof::wb_b1_drop , real::detail::prof::wb_b2_wrap , il_abandoned , real::detail::prof::pool_incref ,
  real::detail::prof::pool_decref , real::detail::prof::pool_cow_write , real::detail::prof::bounded_backtrack , count_
}
 Secondary events: prefilter work, word-boundary handling, abandons, capture-pool traffic. More...
 

Functions

constexpr void real::detail::prof::tick_route (route r) noexcept
 Bill one dispatch to route r. Erased entirely unless REAL_PROFILE is defined.
 
constexpr void real::detail::prof::tick_event (event e) noexcept
 Bill one occurrence of e. Erased entirely unless REAL_PROFILE is defined.
 
constexpr void real::detail::prof::tick_thread_count (std::size_t n) noexcept
 Bill one step() carrying n live threads. Erased entirely unless REAL_PROFILE is defined.
 
constexpr void real::detail::prof::tick_prefilter_candidate () noexcept
 Bill one candidate a prefilter produced. Erased entirely unless REAL_PROFILE is defined.
 
constexpr void real::detail::prof::tick_prefilter_rejected () noexcept
 Bill one prefilter candidate REJECTED by confirmation. See tick_prefilter_candidate for the scope these two share.
 

Detailed Description

Optional route-attribution counters — the profiling substrate.

Codegen-invisible when OFF (default): tick helpers are empty always_inline functions — no branch, no thread_local touch, no layout change. Counters and harness helpers exist only under -DREAL_PROFILE, so coverage builds never see dead instrumented paths. When ON, increments skip constant evaluation.

Measure ns/B on a profile-OFF build and route counters on a profile-ON build of the same (pattern, corpus, surface). Never mix.