OTel middleware overhead is 21x — needs fast path optimization #70

Closed
opened 2026-02-22 13:38:53 +00:00 by ash · 0 comments
Owner

Problem

Benchmarks show 367ns bare vs 7900ns with tracing (21x overhead). Unacceptable.

Fix

  • Add IsRecording() early exit — skip attribute building when no active trace
  • Pre-allocate attribute slices
  • Benchmark with noop exporter to separate dispatch cost from exporter cost
  • Add noop-span fast path
  • Target: <5% overhead when tracing is inactive, <20% when active

Acceptance

  • Benchmark: bare vs otel-inactive vs otel-active
  • <5% overhead when tracing not active
  • Pre-allocated attributes
## Problem Benchmarks show 367ns bare vs 7900ns with tracing (21x overhead). Unacceptable. ## Fix - Add IsRecording() early exit — skip attribute building when no active trace - Pre-allocate attribute slices - Benchmark with noop exporter to separate dispatch cost from exporter cost - Add noop-span fast path - Target: <5% overhead when tracing is inactive, <20% when active ## Acceptance - [ ] Benchmark: bare vs otel-inactive vs otel-active - [ ] <5% overhead when tracing not active - [ ] Pre-allocated attributes
ash closed this issue 2026-02-22 15:08:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ash/eskit#70
No description provided.