Skip to content

perf: const-ify some logging thread-local variables#3513

Merged
realFlowControl merged 1 commit intomasterfrom
levi/const-thread-locals
Dec 2, 2025
Merged

perf: const-ify some logging thread-local variables#3513
realFlowControl merged 1 commit intomasterfrom
levi/const-thread-locals

Conversation

@morrisonlevi
Copy link
Copy Markdown
Collaborator

@morrisonlevi morrisonlevi commented Dec 2, 2025

Description

Perf is not the real story here, but it's technically true. The rest is speculative:

TRACING_GUARDS is involved in some inexplicable crash reports. Making it const will simplify the runtime, because it no longer needs to lazily initialize the thread-local storage for it; see thread_local's docs. I am hoping that somehow that this helps, but there's no downside to trying.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@morrisonlevi morrisonlevi marked this pull request as ready for review December 2, 2025 00:31
@morrisonlevi morrisonlevi requested a review from a team as a code owner December 2, 2025 00:31
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Dec 2, 2025

Benchmarks [ tracer ]

Benchmark execution time: 2025-12-02 01:07:22

Comparing candidate commit bfb5847 in PR branch levi/const-thread-locals with baseline commit 437fc46 in branch master.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 193 metrics, 0 unstable metrics.

scenario:TraceSerializationBench/benchSerializeTrace

  • 🟩 execution_time [-44.015µs; -30.085µs] or [-9.678%; -6.615%]

@realFlowControl realFlowControl merged commit 63cb4e3 into master Dec 2, 2025
2007 of 2008 checks passed
@realFlowControl realFlowControl deleted the levi/const-thread-locals branch December 2, 2025 07:27
@github-actions github-actions Bot added this to the 1.15.0 milestone Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants