Fast path for primitive attributes boosts OTel span creation up to 24%
DanielLockyer · x · 2026-11-18
Another merged OTel JS SDK perf PR (#7356) by Daniel Lockyer. Most span attribute values are plain strings/numbers/booleans, yet all went through the general path: isAnyValue() allocates a WeakSet (for circular-reference detection) on every call and runs for every value in cleanAttributes; maybeAddAttribute() also validated and copied values generically.
The change adds a fast path for primitive values that skips the WeakSet allocation and generic copying, yielding up to 24% more ops/s for span creation.
More from Infra
- 0.5B Rumble-2-Flash ASR beats Whisper large-v3 with 30% fewer errors at a third the size — ricklamers · 2026-11-18
- Nvidia halts shipments of US-approved AI chips to China, Reuters reports — minchoi · 2026-11-18
- Analyst stands by $20 trillion Nvidia market cap thesis by 2030 — Beth_Kindig · 2026-11-18
- armless: A Rust-Written AArch64 Emulator Boots Linux 6.8 in a Browser Tab — sull · 2026-11-18
- Named imports fix V8 inlining: OTel JS Tracer gets ~2x throughput — DanielLockyer · 2026-11-18
- Swap Object.entries for Object.keys to cut allocations in OTel cleanAttributes — DanielLockyer · 2026-11-18