REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::detail::prof Namespace Reference

Opt-in route/work counters, compiled out unless the profiling build flag is set. More...

Enumerations

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

Functions

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

Detailed Description

Opt-in route/work counters, compiled out unless the profiling build flag is set.

Enumeration Type Documentation

◆ event

enum class real::detail::prof::event : std::uint8_t
strong

Secondary events: prefilter work, word-boundary handling, abandons, capture-pool traffic.

Enumerator
wb_b1_drop 

compile-time drop observed at first dispatch

wb_b2_wrap 

runtime wrap: class/cp loop with wb_lead|wb_trail

pool_incref 

COW capture-block refcount taken (one per split in the epsilon walk)

pool_decref 

COW capture-block refcount dropped (one per thread death)

pool_cow_write 

COW capture-block written (one per save, group 0 included)

◆ route

enum class real::detail::prof::route : std::uint8_t
strong

Named once-per-dispatch routes (Tier 1). Always visible so tick call sites compile OFF.

Enumerator
fixed_shape_pair 

heterogeneous fixed shape, two-position vector prefilter.

aho_corasick 

multi-literal automaton, past the branch-count threshold.

lazy_dfa_anchored 

first-byte candidate + anchored_end

lazy_dfa_fwd_rev 

unanchored forward + reverse

possessive_byte_loop 

bare/suffixed possessive literal-byte +/++ (byte_loop_possessive).

possessive_class_loop 

bare/suffixed possessive class+/++ (klass_loop_possessive).

possessive_cp_class_loop 

bare/suffixed possessive cp-class +/++ (klass_cp_loop_possessive).

possessive_delimited 

literal-prefix + possessive loop + literal-suffix ("quoted").

Function Documentation

◆ tick_bytes()

constexpr void real::detail::prof::tick_bytes ( std::uint64_t  n)
constexprnoexcept

Bill n scanned bytes. Erased entirely unless REAL_PROFILE is defined.

Parameters
[in]nBytes the caller just consumed.

◆ tick_event()

constexpr void real::detail::prof::tick_event ( event  e)
constexprnoexcept

Bill one occurrence of e. Erased entirely unless REAL_PROFILE is defined.

Parameters
[in]eThe event to count.

◆ tick_prefilter_candidate()

constexpr void real::detail::prof::tick_prefilter_candidate ( )
constexprnoexcept

Bill one candidate a prefilter produced. Erased entirely unless REAL_PROFILE is defined.

SCOPE, STATED because a counter whose meaning is guessed is barely better than a dead one: counters::prefilter_candidates and counters::prefilter_rejected (named here as code because they exist only in a REAL_PROFILE build) cover the INNER-LITERAL route's memmem loop and nothing else. One candidate is one hit find_literal returned; one rejection is one hit whose reverse walk reached no match start, so the loop advanced. Other routes have their own notion of a candidate and are deliberately not folded in, so a zero here is not a statement about them.

◆ tick_route()

constexpr void real::detail::prof::tick_route ( route  r)
constexprnoexcept

Bill one dispatch to route r. Erased entirely unless REAL_PROFILE is defined.

Parameters
[in]rThe route that handled the search.

◆ tick_run_len()

constexpr void real::detail::prof::tick_run_len ( std::size_t  n)
constexprnoexcept

Record a run of n accepted units. Erased entirely unless REAL_PROFILE is defined.

Parameters
[in]nThe run's length.

◆ tick_thread_count()

constexpr void real::detail::prof::tick_thread_count ( std::size_t  n)
constexprnoexcept

Bill one step() carrying n live threads. Erased entirely unless REAL_PROFILE is defined.

Parameters
[in]nThreads in the current list as the step begins.