This deferred specification records the possible optimization of function-name filtering and profiling. It is not part of the field-statistics implementation and currently has no implementation branch.
1. Problem to Measure
Logging allowlists and profiling currently identify instrumented functions by name. Emitted logging is normally dominated by formatting and I/O, but filtered calls in hot loops and repeated profiler start/end name searches may have measurable cost. That cost must be benchmarked before changing the system.
2. Recorded Direction
If benchmarks justify the work:
- give instrumented application functions a compile-time
FunctionId or a call-site-cached registry handle;
- resolve configured names once into a bitset/indexed allow table;
- make profiler start/end update directly indexed state;
- check log level before function filtering in every hot-path macro;
- parse profiling mode once at ingress; and
- retain canonical function names for YAML, diagnostics, errors, and output.
The implementation should preserve existing logging macros, log formats, profiling files, and default behavior as far as possible. A cached handle may be less intrusive than a manually maintained enum of every C function; the benchmark/prototype phase chooses between them.
3. Explicit Boundaries
This work does not:
- reuse
FieldId or create one universal identity namespace;
- assign IDs to filenames, arbitrary configuration values, PETSc object names, DMSwarm field names, or user-defined postprocessing labels;
- replace boundary-condition enums/function pointers already resolved at ingress;
- redesign runtime physical-solution monitoring or scientific statistics; or
- block Field Statistics.
One-time string comparisons at external ingress and presentation boundaries are correct and remain.
4. Future Plan
- Benchmark disabled, filtered, selected, and all-function logging/profiling on representative serial and MPI runs.
- Inventory call sites and macros; identify only repeated runtime lookups.
- Prototype cached handles and compile-time IDs without changing output.
- Select the simpler design that demonstrates a material improvement.
- Add behavior, concurrency, and overhead regressions, then update monitoring and contributor documentation.
This work receives its own branch series only after explicit approval.