Opt-in instrumentation for the IC backend, enabled with -d:icBNodeProf. Off, every template below is discard and nothing is linked in.
It lives in its own module with NO compiler imports so that any stage can use it without creating a cycle — bnode needs it for the accessors, nifbackend for the stage phases, cgen for what happens per routine.
Each backend process appends ONE line to $NIM_IC_BNODE_PROF at exit (or to stderr when that is unset), because a --ic:on build fans out a process per module per stage and interleaved writes would tear. Use -d:icNoParallel when the numbers need to be attributable to a particular module.
Counts are for volume, timings for cost, and the two answer different questions: the accessors turned out to be 700k calls worth 8ms, while info was 259k calls worth 1.36s. Neither number alone would have found that.
Templates
template icProfStart(s: untyped)
- Source Edit
template icProfStop(s: untyped)
- Source Edit
template timedOutermost(s: untyped; body: untyped)
- Source Edit