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

[TraceQL] Improve performance of select() queries #4438

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

mdisibio
Copy link
Contributor

@mdisibio mdisibio commented Dec 11, 2024

What this PR does:
This fixes the internal processing of some traceql queries to support more cases where AllConditions should be true- notably select() queries. This means we can push all of the filtering down to storage more efficiently. The code change is to remove the check at the top when any multiple pipeline stages exist, and instead push let the individual elements decide. There are some remaining queries that maybe should also be AllConditions like { } | avg(duration) > 1s, but they are left unchanged until they can be reviewed more thoroughly.

Benchmark:

goos: darwin
goarch: arm64
pkg: github.com/grafana/tempo/tempodb/encoding/vparquet3
cpu: Apple M4 Pro
                                                 │  before.txt  │              after.txt               │
                                                 │    sec/op    │    sec/op      vs base               │
BackendBlockTraceQL/spanAttValMatch                 66.19m ± 1%    68.19m ±  2%   +3.03% (p=0.002 n=6)
BackendBlockTraceQL/spanAttValNoMatch               1.552m ± 1%    1.582m ±  1%   +1.97% (p=0.004 n=6)
BackendBlockTraceQL/spanAttIntrinsicMatch           36.95m ± 1%    37.99m ±  3%   +2.80% (p=0.004 n=6)
BackendBlockTraceQL/spanAttIntrinsicNoMatch         1.213m ± 1%    1.226m ± 29%   +1.05% (p=0.015 n=6)
BackendBlockTraceQL/resourceAttValMatch             290.4m ± 1%    294.8m ±  1%   +1.54% (p=0.002 n=6)
BackendBlockTraceQL/resourceAttValNoMatch           1.223m ± 1%    1.231m ±  1%   +0.65% (p=0.002 n=6)
BackendBlockTraceQL/resourceAttIntrinsicMatch       9.966m ± 1%   10.140m ±  1%   +1.75% (p=0.002 n=6)
BackendBlockTraceQL/resourceAttIntrinsicMatch#01    1.203m ± 0%    1.213m ±  1%   +0.84% (p=0.002 n=6)
BackendBlockTraceQL/traceOrMatch                    149.1m ± 1%    149.8m ±  1%        ~ (p=0.132 n=6)
BackendBlockTraceQL/traceOrNoMatch                  143.2m ± 2%    146.3m ±  2%   +2.14% (p=0.009 n=6)
BackendBlockTraceQL/mixedValNoMatch                 93.23m ± 2%    93.67m ±  1%        ~ (p=0.310 n=6)
BackendBlockTraceQL/mixedValMixedMatchAnd           1.365m ± 1%    1.381m ±  1%        ~ (p=0.180 n=6)
BackendBlockTraceQL/mixedValMixedMatchOr            91.70m ± 1%    92.40m ±  1%        ~ (p=0.093 n=6)
BackendBlockTraceQL/count                           239.7m ± 2%    243.9m ±  2%        ~ (p=0.065 n=6)
BackendBlockTraceQL/struct                          268.8m ± 4%    268.9m ±  4%        ~ (p=0.818 n=6)
BackendBlockTraceQL/||                              106.0m ± 1%    106.0m ±  1%        ~ (p=0.937 n=6)
BackendBlockTraceQL/mixed                           30.36m ± 0%    30.71m ±  1%   +1.14% (p=0.002 n=6)
BackendBlockTraceQL/complex                         1.770m ± 1%    1.770m ±  2%        ~ (p=0.818 n=6)
BackendBlockTraceQL/select                         199.03m ± 2%    15.68m ±  3%  -92.12% (p=0.002 n=6)
geomean                                             24.97m         22.09m        -11.53%

                                                 │  before.txt  │                after.txt                │
                                                 │     B/s      │      B/s        vs base                 │
BackendBlockTraceQL/spanAttValMatch                216.9Mi ± 1%    210.5Mi ±  2%     -2.94% (p=0.002 n=6)
BackendBlockTraceQL/spanAttValNoMatch              1.076Gi ± 1%    1.055Gi ±  1%     -1.93% (p=0.004 n=6)
BackendBlockTraceQL/spanAttIntrinsicMatch          405.6Mi ± 1%    394.5Mi ±  3%     -2.72% (p=0.004 n=6)
BackendBlockTraceQL/spanAttIntrinsicNoMatch        960.2Mi ± 1%    950.2Mi ± 23%     -1.04% (p=0.015 n=6)
BackendBlockTraceQL/resourceAttValMatch            48.74Mi ± 1%    48.00Mi ±  1%     -1.51% (p=0.002 n=6)
BackendBlockTraceQL/resourceAttValNoMatch          141.1Mi ± 1%    140.2Mi ±  1%     -0.64% (p=0.002 n=6)
BackendBlockTraceQL/resourceAttIntrinsicMatch      1.234Gi ± 1%    1.213Gi ±  1%     -1.72% (p=0.002 n=6)
BackendBlockTraceQL/resourceAttIntrinsicMatch#01   172.1Mi ± 0%    170.7Mi ±  1%     -0.83% (p=0.002 n=6)
BackendBlockTraceQL/traceOrMatch                   87.23Mi ± 1%    86.80Mi ±  1%          ~ (p=0.143 n=6)
BackendBlockTraceQL/traceOrNoMatch                 6.056Mi ± 2%    5.927Mi ±  2%     -2.13% (p=0.009 n=6)
BackendBlockTraceQL/mixedValNoMatch                21.25Mi ± 2%    21.16Mi ±  1%          ~ (p=0.310 n=6)
BackendBlockTraceQL/mixedValMixedMatchAnd          135.4Mi ± 1%    133.9Mi ±  1%          ~ (p=0.139 n=6)
BackendBlockTraceQL/mixedValMixedMatchOr           166.4Mi ± 1%    165.2Mi ±  1%          ~ (p=0.093 n=6)
BackendBlockTraceQL/count                          58.99Mi ± 2%    57.97Mi ±  2%          ~ (p=0.065 n=6)
BackendBlockTraceQL/struct                         58.67Mi ± 4%    58.66Mi ±  4%          ~ (p=0.851 n=6)
BackendBlockTraceQL/||                             134.2Mi ± 1%    134.2Mi ±  1%          ~ (p=0.937 n=6)
BackendBlockTraceQL/mixed                          460.6Mi ± 0%    455.4Mi ±  1%     -1.13% (p=0.002 n=6)
BackendBlockTraceQL/complex                        870.9Mi ± 3%    869.7Mi ±  1%          ~ (p=0.818 n=6)
BackendBlockTraceQL/select                         71.52Mi ± 2%   907.61Mi ±  3%  +1169.10% (p=0.002 n=6)
geomean                                            156.0Mi         176.4Mi          +13.02%

                                                 │ before.txt  │              after.txt              │
                                                 │  MB_io/op   │  MB_io/op    vs base                │
BackendBlockTraceQL/spanAttValMatch                 15.05 ± 0%    15.05 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/spanAttValNoMatch               1.793 ± 0%    1.793 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/spanAttIntrinsicMatch           15.72 ± 0%    15.72 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/spanAttIntrinsicNoMatch         1.221 ± 0%    1.221 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/resourceAttValMatch             14.84 ± 0%    14.84 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/resourceAttValNoMatch          180.9m ± 0%   180.9m ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/resourceAttIntrinsicMatch       13.21 ± 0%    13.21 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/resourceAttIntrinsicMatch#01   217.1m ± 0%   217.1m ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/traceOrMatch                    13.63 ± 0%    13.63 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/traceOrNoMatch                 909.1m ± 0%   909.1m ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/mixedValNoMatch                 2.078 ± 0%    2.078 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/mixedValMixedMatchAnd          193.9m ± 0%   193.9m ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/mixedValMixedMatchOr            16.00 ± 0%    16.00 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/count                           14.82 ± 0%    14.82 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/struct                          16.54 ± 0%    16.54 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/||                              14.91 ± 0%    14.91 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/mixed                           14.66 ± 0%    14.66 ± 0%       ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/complex                         1.607 ± 1%    1.611 ± 2%       ~ (p=0.937 n=6)
BackendBlockTraceQL/select                          14.93 ± 0%    14.93 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                             4.085         4.085       +0.01%
¹ all samples are equal

                                                 │   before.txt   │              after.txt               │
                                                 │      B/op      │     B/op       vs base               │
BackendBlockTraceQL/spanAttValMatch                  29.68Mi ± 0%   29.74Mi ±  1%        ~ (p=0.699 n=6)
BackendBlockTraceQL/spanAttValNoMatch                1.539Mi ± 0%   1.539Mi ±  0%        ~ (p=0.329 n=6)
BackendBlockTraceQL/spanAttIntrinsicMatch            14.80Mi ± 0%   14.79Mi ±  1%        ~ (p=0.485 n=6)
BackendBlockTraceQL/spanAttIntrinsicNoMatch          1.096Mi ± 0%   1.096Mi ±  0%        ~ (p=0.781 n=6)
BackendBlockTraceQL/resourceAttValMatch              316.7Mi ± 0%   317.0Mi ±  0%        ~ (p=0.699 n=6)
BackendBlockTraceQL/resourceAttValNoMatch            1.071Mi ± 0%   1.071Mi ±  0%        ~ (p=0.275 n=6)
BackendBlockTraceQL/resourceAttIntrinsicMatch        1.321Mi ± 0%   1.321Mi ±  0%        ~ (p=0.331 n=6)
BackendBlockTraceQL/resourceAttIntrinsicMatch#01     1.073Mi ± 0%   1.073Mi ±  0%        ~ (p=0.701 n=6)
BackendBlockTraceQL/traceOrMatch                     12.72Mi ± 7%   12.89Mi ±  5%        ~ (p=0.589 n=6)
BackendBlockTraceQL/traceOrNoMatch                   11.17Mi ± 0%   11.17Mi ±  2%        ~ (p=0.240 n=6)
BackendBlockTraceQL/mixedValNoMatch                  1.581Mi ± 0%   1.580Mi ±  0%        ~ (p=0.567 n=6)
BackendBlockTraceQL/mixedValMixedMatchAnd            1.074Mi ± 0%   1.074Mi ±  0%        ~ (p=0.922 n=6)
BackendBlockTraceQL/mixedValMixedMatchOr             2.117Mi ± 2%   2.116Mi ±  2%        ~ (p=0.589 n=6)
BackendBlockTraceQL/count                            231.6Mi ± 0%   231.4Mi ±  0%        ~ (p=0.589 n=6)
BackendBlockTraceQL/struct                           11.99Mi ± 4%   12.00Mi ± 23%        ~ (p=0.699 n=6)
BackendBlockTraceQL/||                               16.41Mi ± 0%   16.41Mi ±  0%        ~ (p=0.240 n=6)
BackendBlockTraceQL/mixed                            4.211Mi ± 0%   4.211Mi ±  0%        ~ (p=0.240 n=6)
BackendBlockTraceQL/complex                          1.139Mi ± 0%   1.138Mi ±  0%        ~ (p=0.180 n=6)
BackendBlockTraceQL/select                         112.879Mi ± 1%   1.675Mi ±  0%  -98.52% (p=0.002 n=6)
geomean                                              6.665Mi        5.344Mi        -19.82%

                                                 │  before.txt  │               after.txt               │
                                                 │  allocs/op   │  allocs/op    vs base                 │
BackendBlockTraceQL/spanAttValMatch                 313.6k ± 0%   313.6k ±  0%        ~ (p=0.589 n=6)
BackendBlockTraceQL/spanAttValNoMatch               17.30k ± 0%   17.30k ±  0%        ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/spanAttIntrinsicMatch           118.4k ± 0%   118.4k ±  0%        ~ (p=0.905 n=6)
BackendBlockTraceQL/spanAttIntrinsicNoMatch         17.23k ± 0%   17.23k ±  0%        ~ (p=1.000 n=6)
BackendBlockTraceQL/resourceAttValMatch             2.293M ± 0%   2.293M ±  0%        ~ (p=0.307 n=6)
BackendBlockTraceQL/resourceAttValNoMatch           17.26k ± 0%   17.26k ±  0%        ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/resourceAttIntrinsicMatch       18.55k ± 0%   18.55k ±  0%        ~ (p=1.000 n=6)
BackendBlockTraceQL/resourceAttIntrinsicMatch#01    17.26k ± 0%   17.26k ±  0%        ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/traceOrMatch                    120.2k ± 4%   121.3k ±  3%        ~ (p=0.108 n=6)
BackendBlockTraceQL/traceOrNoMatch                  111.7k ± 0%   111.7k ±  0%        ~ (p=0.636 n=6)
BackendBlockTraceQL/mixedValNoMatch                 18.04k ± 0%   18.04k ±  0%        ~ (p=0.567 n=6)
BackendBlockTraceQL/mixedValMixedMatchAnd           17.30k ± 0%   17.30k ±  0%        ~ (p=1.000 n=6) ¹
BackendBlockTraceQL/mixedValMixedMatchOr            24.17k ± 0%   24.17k ±  0%        ~ (p=0.697 n=6)
BackendBlockTraceQL/count                           1.476M ± 0%   1.476M ±  0%        ~ (p=0.327 n=6)
BackendBlockTraceQL/struct                          53.40k ± 3%   53.74k ± 26%        ~ (p=0.394 n=6)
BackendBlockTraceQL/||                              141.7k ± 0%   141.6k ±  0%        ~ (p=0.154 n=6)
BackendBlockTraceQL/mixed                           47.56k ± 0%   47.56k ±  0%   -0.00% (p=0.043 n=6)
BackendBlockTraceQL/complex                         17.76k ± 0%   17.76k ±  0%        ~ (p=0.922 n=6)
BackendBlockTraceQL/select                         941.82k ± 1%   22.88k ±  0%  -97.57% (p=0.002 n=6)
geomean                                             70.38k        57.91k        -17.71%

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a shockingly difficult PR to review :). any ideas on the perf regressions? small enough that it may be just benchmark variance?

pkg/traceql/ast.go Show resolved Hide resolved
pkg/traceql/ast.go Show resolved Hide resolved
pkg/traceql/ast.go Show resolved Hide resolved
@mdisibio
Copy link
Contributor Author

mdisibio commented Dec 12, 2024

Bumped to -count=10 and benchmarks show less variance and now after is faster, so good indicator it is noise. Nothing changed with the fetch or engine for anything except select.

Benchmarks
goos: darwin
goarch: arm64
pkg: github.com/grafana/tempo/tempodb/encoding/vparquet3
cpu: Apple M4 Pro
                                                 │  before.txt  │              after.txt              │
                                                 │    sec/op    │   sec/op     vs base                │
BackendBlockTraceQL/spanAttValMatch                 67.69m ± 2%   66.99m ± 2%        ~ (p=0.481 n=10)
BackendBlockTraceQL/spanAttValNoMatch               1.564m ± 2%   1.546m ± 1%   -1.11% (p=0.000 n=10)
BackendBlockTraceQL/spanAttIntrinsicMatch           37.34m ± 1%   37.31m ± 1%        ~ (p=0.353 n=10)
BackendBlockTraceQL/spanAttIntrinsicNoMatch         1.216m ± 0%   1.205m ± 0%   -0.91% (p=0.000 n=10)
BackendBlockTraceQL/resourceAttValMatch             292.5m ± 1%   293.0m ± 2%        ~ (p=0.315 n=10)
BackendBlockTraceQL/resourceAttValNoMatch           1.216m ± 1%   1.211m ± 1%        ~ (p=0.315 n=10)
BackendBlockTraceQL/resourceAttIntrinsicMatch       10.03m ± 1%   10.05m ± 1%        ~ (p=0.739 n=10)
BackendBlockTraceQL/resourceAttIntrinsicMatch#01    1.196m ± 0%   1.188m ± 0%   -0.73% (p=0.000 n=10)
BackendBlockTraceQL/traceOrMatch                    149.3m ± 1%   149.3m ± 1%        ~ (p=1.000 n=10)
BackendBlockTraceQL/traceOrNoMatch                  143.2m ± 1%   143.3m ± 1%        ~ (p=0.579 n=10)
BackendBlockTraceQL/mixedValNoMatch                 92.26m ± 0%   92.09m ± 0%   -0.18% (p=0.015 n=10)
BackendBlockTraceQL/mixedValMixedMatchAnd           1.348m ± 1%   1.346m ± 1%        ~ (p=0.631 n=10)
BackendBlockTraceQL/mixedValMixedMatchOr            91.35m ± 1%   91.57m ± 1%        ~ (p=0.436 n=10)
BackendBlockTraceQL/count                           239.3m ± 1%   238.2m ± 0%        ~ (p=0.105 n=10)
BackendBlockTraceQL/struct                          271.8m ± 3%   268.4m ± 1%        ~ (p=0.105 n=10)
BackendBlockTraceQL/||                              106.9m ± 1%   106.3m ± 1%        ~ (p=0.123 n=10)
BackendBlockTraceQL/mixed                           30.30m ± 1%   29.95m ± 2%   -1.18% (p=0.015 n=10)
BackendBlockTraceQL/complex                         1.760m ± 0%   1.709m ± 0%   -2.92% (p=0.000 n=10)
BackendBlockTraceQL/select                         200.78m ± 2%   15.62m ± 1%  -92.22% (p=0.000 n=10)
geomean                                             25.03m        21.76m       -13.05%

                                                 │  before.txt  │                after.txt                │
                                                 │     B/s      │      B/s       vs base                  │
BackendBlockTraceQL/spanAttValMatch                212.0Mi ± 2%    214.3Mi ± 2%          ~ (p=0.481 n=10)
BackendBlockTraceQL/spanAttValNoMatch              1.068Gi ± 2%    1.080Gi ± 1%     +1.12% (p=0.000 n=10)
BackendBlockTraceQL/spanAttIntrinsicMatch          401.4Mi ± 1%    401.7Mi ± 1%          ~ (p=0.353 n=10)
BackendBlockTraceQL/spanAttIntrinsicNoMatch        957.8Mi ± 0%    966.6Mi ± 0%     +0.92% (p=0.000 n=10)
BackendBlockTraceQL/resourceAttValMatch            48.38Mi ± 1%    48.29Mi ± 2%          ~ (p=0.305 n=10)
BackendBlockTraceQL/resourceAttValNoMatch          141.9Mi ± 1%    142.4Mi ± 1%          ~ (p=0.315 n=10)
BackendBlockTraceQL/resourceAttIntrinsicMatch      1.227Gi ± 1%    1.223Gi ± 1%          ~ (p=0.756 n=10)
BackendBlockTraceQL/resourceAttIntrinsicMatch#01   173.0Mi ± 0%    174.3Mi ± 0%     +0.74% (p=0.000 n=10)
BackendBlockTraceQL/traceOrMatch                   87.08Mi ± 1%    87.11Mi ± 1%          ~ (p=0.986 n=10)
BackendBlockTraceQL/traceOrNoMatch                 6.056Mi ± 1%    6.051Mi ± 1%          ~ (p=0.616 n=10)
BackendBlockTraceQL/mixedValNoMatch                21.48Mi ± 0%    21.52Mi ± 0%     +0.18% (p=0.021 n=10)
BackendBlockTraceQL/mixedValMixedMatchAnd          137.2Mi ± 1%    137.4Mi ± 1%          ~ (p=0.617 n=10)
BackendBlockTraceQL/mixedValMixedMatchOr           167.0Mi ± 1%    166.6Mi ± 1%          ~ (p=0.436 n=10)
BackendBlockTraceQL/count                          59.08Mi ± 1%    59.34Mi ± 0%          ~ (p=0.101 n=10)
BackendBlockTraceQL/struct                         58.04Mi ± 3%    58.76Mi ± 1%          ~ (p=0.105 n=10)
BackendBlockTraceQL/||                             133.0Mi ± 1%    133.8Mi ± 1%          ~ (p=0.123 n=10)
BackendBlockTraceQL/mixed                          461.5Mi ± 1%    467.0Mi ± 2%     +1.20% (p=0.015 n=10)
BackendBlockTraceQL/complex                        872.2Mi ± 2%    893.1Mi ± 1%     +2.39% (p=0.000 n=10)
BackendBlockTraceQL/select                         70.90Mi ± 2%   911.57Mi ± 1%  +1185.79% (p=0.000 n=10)
geomean                                            155.7Mi         179.0Mi         +14.97%

                                                 │ before.txt  │              after.txt               │
                                                 │  MB_io/op   │  MB_io/op    vs base                 │
BackendBlockTraceQL/spanAttValMatch                 15.05 ± 0%    15.05 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/spanAttValNoMatch               1.793 ± 0%    1.793 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/spanAttIntrinsicMatch           15.72 ± 0%    15.72 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/spanAttIntrinsicNoMatch         1.221 ± 0%    1.221 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/resourceAttValMatch             14.84 ± 0%    14.84 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/resourceAttValNoMatch          180.9m ± 0%   180.9m ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/resourceAttIntrinsicMatch       13.21 ± 0%    13.21 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/resourceAttIntrinsicMatch#01   217.1m ± 0%   217.1m ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/traceOrMatch                    13.63 ± 0%    13.63 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/traceOrNoMatch                 909.1m ± 0%   909.1m ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/mixedValNoMatch                 2.078 ± 0%    2.078 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/mixedValMixedMatchAnd          193.9m ± 0%   193.9m ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/mixedValMixedMatchOr            16.00 ± 0%    16.00 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/count                           14.82 ± 0%    14.82 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/struct                          16.54 ± 0%    16.54 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/||                              14.91 ± 0%    14.91 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/mixed                           14.66 ± 0%    14.66 ± 0%       ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/complex                         1.613 ± 1%    1.599 ± 1%       ~ (p=0.159 n=10)
BackendBlockTraceQL/select                          14.93 ± 0%    14.93 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                             4.086         4.084       -0.04%
¹ all samples are equal

                                                 │   before.txt   │              after.txt               │
                                                 │      B/op      │     B/op      vs base                │
BackendBlockTraceQL/spanAttValMatch                  29.64Mi ± 1%   29.64Mi ± 0%        ~ (p=0.912 n=10)
BackendBlockTraceQL/spanAttValNoMatch                1.539Mi ± 0%   1.539Mi ± 0%        ~ (p=0.445 n=10)
BackendBlockTraceQL/spanAttIntrinsicMatch            14.80Mi ± 0%   14.79Mi ± 0%        ~ (p=0.353 n=10)
BackendBlockTraceQL/spanAttIntrinsicNoMatch          1.096Mi ± 0%   1.096Mi ± 0%        ~ (p=0.191 n=10)
BackendBlockTraceQL/resourceAttValMatch              316.9Mi ± 0%   316.9Mi ± 0%        ~ (p=0.853 n=10)
BackendBlockTraceQL/resourceAttValNoMatch            1.071Mi ± 0%   1.071Mi ± 0%        ~ (p=0.892 n=10)
BackendBlockTraceQL/resourceAttIntrinsicMatch        1.321Mi ± 0%   1.322Mi ± 0%        ~ (p=0.381 n=10)
BackendBlockTraceQL/resourceAttIntrinsicMatch#01     1.073Mi ± 0%   1.073Mi ± 0%   -0.00% (p=0.019 n=10)
BackendBlockTraceQL/traceOrMatch                     12.72Mi ± 1%   12.71Mi ± 0%        ~ (p=0.093 n=10)
BackendBlockTraceQL/traceOrNoMatch                   11.17Mi ± 0%   11.17Mi ± 0%        ~ (p=0.986 n=10)
BackendBlockTraceQL/mixedValNoMatch                  1.579Mi ± 0%   1.579Mi ± 0%        ~ (p=1.000 n=10)
BackendBlockTraceQL/mixedValMixedMatchAnd            1.074Mi ± 0%   1.074Mi ± 0%        ~ (p=0.880 n=10)
BackendBlockTraceQL/mixedValMixedMatchOr             2.093Mi ± 1%   2.115Mi ± 2%        ~ (p=0.165 n=10)
BackendBlockTraceQL/count                            231.4Mi ± 0%   231.6Mi ± 0%        ~ (p=0.393 n=10)
BackendBlockTraceQL/struct                           12.11Mi ± 4%   11.98Mi ± 3%        ~ (p=0.631 n=10)
BackendBlockTraceQL/||                               16.41Mi ± 0%   16.42Mi ± 0%        ~ (p=0.225 n=10)
BackendBlockTraceQL/mixed                            4.208Mi ± 0%   4.209Mi ± 0%        ~ (p=0.912 n=10)
BackendBlockTraceQL/complex                          1.139Mi ± 0%   1.140Mi ± 0%        ~ (p=0.796 n=10)
BackendBlockTraceQL/select                         113.185Mi ± 2%   1.675Mi ± 0%  -98.52% (p=0.000 n=10)
geomean                                              6.664Mi        5.339Mi       -19.88%

                                                 │  before.txt  │               after.txt               │
                                                 │  allocs/op   │  allocs/op   vs base                  │
BackendBlockTraceQL/spanAttValMatch                 313.6k ± 0%   313.6k ± 0%        ~ (p=0.562 n=10)
BackendBlockTraceQL/spanAttValNoMatch               17.30k ± 0%   17.30k ± 0%        ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/spanAttIntrinsicMatch           118.4k ± 0%   118.4k ± 0%        ~ (p=0.415 n=10)
BackendBlockTraceQL/spanAttIntrinsicNoMatch         17.23k ± 0%   17.23k ± 0%        ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/resourceAttValMatch             2.293M ± 0%   2.293M ± 0%        ~ (p=0.986 n=10)
BackendBlockTraceQL/resourceAttValNoMatch           17.26k ± 0%   17.26k ± 0%        ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/resourceAttIntrinsicMatch       18.55k ± 0%   18.55k ± 0%        ~ (p=1.000 n=10)
BackendBlockTraceQL/resourceAttIntrinsicMatch#01    17.26k ± 0%   17.26k ± 0%        ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/traceOrMatch                    120.2k ± 0%   120.2k ± 0%        ~ (p=0.953 n=10)
BackendBlockTraceQL/traceOrNoMatch                  111.7k ± 0%   111.7k ± 0%        ~ (p=0.870 n=10)
BackendBlockTraceQL/mixedValNoMatch                 18.03k ± 0%   18.03k ± 0%        ~ (p=1.000 n=10)
BackendBlockTraceQL/mixedValMixedMatchAnd           17.30k ± 0%   17.30k ± 0%        ~ (p=1.000 n=10) ¹
BackendBlockTraceQL/mixedValMixedMatchOr            24.17k ± 0%   24.17k ± 0%        ~ (p=0.903 n=10)
BackendBlockTraceQL/count                           1.476M ± 0%   1.476M ± 0%   +0.00% (p=0.003 n=10)
BackendBlockTraceQL/struct                          52.71k ± 1%   53.38k ± 1%   +1.29% (p=0.015 n=10)
BackendBlockTraceQL/||                              141.6k ± 0%   141.7k ± 0%        ~ (p=0.259 n=10)
BackendBlockTraceQL/mixed                           47.56k ± 0%   47.56k ± 0%        ~ (p=1.000 n=10)
BackendBlockTraceQL/complex                         17.76k ± 0%   17.76k ± 0%        ~ (p=0.169 n=10)
BackendBlockTraceQL/select                         942.62k ± 2%   22.88k ± 0%  -97.57% (p=0.000 n=10)
geomean                                             70.33k        57.87k       -17.72%
¹ all samples are equal

Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one!

@mdisibio mdisibio merged commit 90b2ac5 into grafana:main Dec 13, 2024
16 checks passed
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