Summary
When HOOK_TELEMETRY_SINK is unset (telemetry not wired — the default for consumers who have not opted in), the markdown-format producer still performs telemetry-only work before the opt-in guard short-circuits it. Low priority — bounded and dwarfed by markdownlint-cli2, but genuinely unnecessary work when telemetry is off.
Detail
hook::emit_telemetry (plugins/markdown-formatter/hooks/hook-utils.sh) guards on the first line:
[[ -n "${HOOK_TELEMETRY_SINK:-}" ]] || return 0
That guard itself is free. But markdown-format.sh builds the telemetry payload before calling it, unconditionally:
- the
FILE_REL block — 2× cygpath calls on Windows;
data_json — 1× jq -n.
So ~3 telemetry-only subprocesses run per .md edit even when no sink is configured: ≈90ms on Windows (MSYS2 fork() ≈30ms each), ≈9ms on Linux. FILE_REL and data_json are used only for the envelope.
Suggested fix
Gate the FILE_REL + data_json construction behind a cheap sink-presence check (e.g. a hook::telemetry_enabled helper that just tests [[ -n "${HOOK_TELEMETRY_SINK:-}" ]]), so the unwired path does zero telemetry-only subprocesses. REPO_ROOT stays (it is also used for markdownlint config discovery).
Severity
Low — telemetry is opt-in; the cost is small and dominated by the lint itself. Capture, not block.
Summary
When
HOOK_TELEMETRY_SINKis unset (telemetry not wired — the default for consumers who have not opted in), themarkdown-formatproducer still performs telemetry-only work before the opt-in guard short-circuits it. Low priority — bounded and dwarfed bymarkdownlint-cli2, but genuinely unnecessary work when telemetry is off.Detail
hook::emit_telemetry(plugins/markdown-formatter/hooks/hook-utils.sh) guards on the first line:That guard itself is free. But
markdown-format.shbuilds the telemetry payload before calling it, unconditionally:FILE_RELblock — 2×cygpathcalls on Windows;data_json— 1×jq -n.So ~3 telemetry-only subprocesses run per
.mdedit even when no sink is configured: ≈90ms on Windows (MSYS2fork()≈30ms each), ≈9ms on Linux.FILE_RELanddata_jsonare used only for the envelope.Suggested fix
Gate the
FILE_REL+data_jsonconstruction behind a cheap sink-presence check (e.g. ahook::telemetry_enabledhelper that just tests[[ -n "${HOOK_TELEMETRY_SINK:-}" ]]), so the unwired path does zero telemetry-only subprocesses.REPO_ROOTstays (it is also used for markdownlint config discovery).Severity
Low — telemetry is opt-in; the cost is small and dominated by the lint itself. Capture, not block.