Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip,dnm] tracing: peephole optimizations #62227

Commits on Mar 17, 2021

  1. sql: revive BenchmarkTracing

    Fixes cockroachdb#62081. It had rotted after we removed the trace.mode setting. It
    now makes use of a debug-only cluster setting that if enabled, installs
    real spans all sql statements. We'll defer the actual investigation into
    the cause of the slow-down in future PRs.
    
        $ make bench PKG=./pkg/bench  TESTFLAGS='-benchtime=10000x -count 20' \
            BENCHES='BenchmarkTracing' BENCHTIMEOUT=50m > benchmark-tracing.txt
        $ cat benchmark-tracing.txt | grep -v tracing=t | sed 's/tracing=f//' > old.txt
        $ cat benchmark-tracing.txt | grep -v tracing=f | sed 's/tracing=t//' > new.txt
        $ benchstat old.txt new.txt
    
        name                                   old time/op    new time/op    delta
        Tracing/Cockroach//Scan1-24               382µs ± 2%     412µs ± 8%   +7.68%  (p=0.000 n=10+10)
        Tracing/Cockroach//Insert-24              579µs ± 2%     609µs ± 6%   +5.10%  (p=0.000 n=10+10)
        Tracing/MultinodeCockroach//Scan1-24      799µs ± 2%     885µs ± 1%  +10.76%  (p=0.000 n=10+9)
        Tracing/MultinodeCockroach//Insert-24    1.09ms ± 1%    1.14ms ± 2%   +5.04%  (p=0.000 n=9+10)
    
        name                                   old alloc/op   new alloc/op   delta
        Tracing/Cockroach//Scan1-24              25.3kB ± 5%    32.0kB ± 4%  +26.55%  (p=0.000 n=10+10)
        Tracing/Cockroach//Insert-24             38.0kB ± 6%    42.2kB ± 5%  +11.02%  (p=0.000 n=10+10)
        Tracing/MultinodeCockroach//Scan1-24     77.7kB ± 8%    97.1kB ±12%  +25.05%  (p=0.000 n=10+10)
        Tracing/MultinodeCockroach//Insert-24     107kB ± 8%     115kB ± 7%   +7.66%  (p=0.023 n=10+10)
    
        name                                   old allocs/op  new allocs/op  delta
        Tracing/Cockroach//Scan1-24                 256 ± 1%       280 ± 1%   +9.10%  (p=0.000 n=9+9)
        Tracing/Cockroach//Insert-24                301 ± 2%       321 ± 1%   +6.64%  (p=0.000 n=10+10)
        Tracing/MultinodeCockroach//Scan1-24        787 ± 2%       921 ± 2%  +17.04%  (p=0.000 n=9+9)
        Tracing/MultinodeCockroach//Insert-24       748 ± 1%       805 ± 2%   +7.61%  (p=0.000 n=9+9)
    
    Release note: None
    irfansharif committed Mar 17, 2021
    Configuration menu
    Copy the full SHA
    209b26a View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2021

  1. [wip,dnm] tracing: retrieve log tags from parent span...

    Instead of the incoming ctx. Going through the ctx package is expensive,
    and log tags are unlikely to change between parent and child spans.
    
    ---
    
    Actually, drop log tags altogether.
    
    Release note: None
    irfansharif committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    9e1abc7 View commit details
    Browse the repository at this point in the history
  2. [wip,dnm] tracing: drop span tags altogether

    Release note: None
    irfansharif committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    41d04f7 View commit details
    Browse the repository at this point in the history
  3. [wip,dnm] tracing: more peephole optimizations

    - Reduce lock contention by only deleting root spans from registry.
    - Don't materialize span recordings unless absolutely needed.
    - Compute span duration outside of mutex
    
    Release note: None
    irfansharif committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    d34b2c9 View commit details
    Browse the repository at this point in the history
  4. [wip,dnm] tracing: misc. clean ups

    Tracer.AlwaysTrace is redundant. We can also avoid doing opentracing
    stuff if we have no external sinks configured.
    
    Release note: None
    irfansharif committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    9915edb View commit details
    Browse the repository at this point in the history
  5. [wip,dnm] execinfra: drop empty trace metadata

    Release note: None
    irfansharif committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    924783c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8974b98 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6460698 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    aad6765 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a535968 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    b4cc691 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2021

  1. Configuration menu
    Copy the full SHA
    1631298 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    60fdf74 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2021

  1. Revert "[wip,dnm] tracing: group allocation of span objects"

    This reverts commit 1631298.
    
    Release note: None
    irfansharif committed Mar 22, 2021
    Configuration menu
    Copy the full SHA
    479af6d View commit details
    Browse the repository at this point in the history
  2. [wip,dnm] tracing: pool more meta objects,

    - use an optimizedCtx for collapsed spans
    - avoid stepping through interface for carrier
    - mutate incoming ctx's metadata.MD directly
    - disable emptry registry check, we broke it a few commits ago
    ([wip,dnm] tracing: move from interface type; avoid string.ToLower)
    - skip some common span tags
    
    Release note: None
    irfansharif committed Mar 22, 2021
    Configuration menu
    Copy the full SHA
    f0f6d58 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    186a292 View commit details
    Browse the repository at this point in the history