Skip to content

Conversation

@ultrotter
Copy link
Contributor

If QMatches doesn't update the map, multiple queries can execute
concurrently, with just a read lock. We have had this in production for
over a year, and it significantly improves performance for cases where
many silences need to be processed against many alerts.

This makes load time a bit slower, but a snapshot file with about
120.000 silences can still load in about 2 seconds, so we can accept
this, in exchange for the ability to run queries in parallel.

@SuperQ
Copy link
Member

SuperQ commented Nov 5, 2025

Looks like this needs a rebase.

Guido Trotter added 3 commits November 5, 2025 11:23
If QMatches doesn't update the map, multiple queries can execute
concurrently, with just a read lock. We have had this in production for
over a year, and it significantly improves performance for cases where
many silences need to be processed against many alerts.

This makes load time a bit slower, but a snapshot file with about
120.000 silences can still load in about 2 seconds, so we can accept
this, in exchange for the ability to run queries in parallel.

goos: linux
goarch: amd64
pkg: github.com/prometheus/alertmanager/cluster
cpu: AMD EPYC Processor (with IBPB)
           │ bench-before.txt │          bench-after.txt           │
           │      sec/op      │     sec/op       vs base           │
WriteTo-40    0.003794n ± ∞ ¹   0.004227n ± ∞ ¹  ~ (p=1.000 n=1) ²
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

           │ bench-before.txt │        bench-after.txt         │
           │       B/op       │    B/op      vs base           │
WriteTo-40        0.000 ± ∞ ¹   0.000 ± ∞ ¹  ~ (p=1.000 n=1) ²
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

           │ bench-before.txt │        bench-after.txt         │
           │    allocs/op     │  allocs/op   vs base           │
WriteTo-40        0.000 ± ∞ ¹   0.000 ± ∞ ¹  ~ (p=1.000 n=1) ²
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

pkg: github.com/prometheus/alertmanager/inhibit
                                                      │ bench-before.txt │           bench-after.txt            │
                                                      │      sec/op      │    sec/op     vs base                │
Mutes/1_inhibition_rule,_1_inhibiting_alert-40              1.248µ ± ∞ ¹   1.340µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10_inhibition_rules,_1_inhibiting_alert-40            1.298µ ± ∞ ¹   1.326µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/100_inhibition_rules,_1_inhibiting_alert-40           1.347µ ± ∞ ¹   1.391µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1000_inhibition_rules,_1_inhibiting_alert-40          1.498µ ± ∞ ¹   1.578µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10000_inhibition_rules,_1_inhibiting_alert-40         1.685µ ± ∞ ¹   1.502µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_10_inhibiting_alerts-40            1.443µ ± ∞ ¹   1.521µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_100_inhibiting_alerts-40           1.453µ ± ∞ ¹   1.561µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_1000_inhibiting_alerts-40          1.423µ ± ∞ ¹   1.511µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_10000_inhibiting_alerts-40         1.389µ ± ∞ ¹   1.441µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/100_inhibition_rules,_1000_inhibiting_alerts-40       1.218µ ± ∞ ¹   1.306µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10_inhibition_rules,_last_rule_matches-40             3.054µ ± ∞ ¹   3.114µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/100_inhibition_rules,_last_rule_matches-40            19.57µ ± ∞ ¹   19.47µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1000_inhibition_rules,_last_rule_matches-40           187.4µ ± ∞ ¹   188.9µ ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10000_inhibition_rules,_last_rule_matches-40          1.944m ± ∞ ¹   1.955m ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                     4.239µ         4.356µ        +2.75%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

                                                      │ bench-before.txt │           bench-after.txt           │
                                                      │       B/op       │    B/op      vs base                │
Mutes/1_inhibition_rule,_1_inhibiting_alert-40               488.0 ± ∞ ¹   488.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10_inhibition_rules,_1_inhibiting_alert-40             488.0 ± ∞ ¹   488.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/100_inhibition_rules,_1_inhibiting_alert-40            489.0 ± ∞ ¹   489.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1000_inhibition_rules,_1_inhibiting_alert-40           488.0 ± ∞ ¹   488.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10000_inhibition_rules,_1_inhibiting_alert-40          489.0 ± ∞ ¹   489.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_10_inhibiting_alerts-40             488.0 ± ∞ ¹   488.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_100_inhibiting_alerts-40            488.0 ± ∞ ¹   488.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_1000_inhibiting_alerts-40           488.0 ± ∞ ¹   488.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_10000_inhibiting_alerts-40          488.0 ± ∞ ¹   488.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/100_inhibition_rules,_1000_inhibiting_alerts-40        488.0 ± ∞ ¹   488.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10_inhibition_rules,_last_rule_matches-40              472.0 ± ∞ ¹   472.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/100_inhibition_rules,_last_rule_matches-40             472.0 ± ∞ ¹   472.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1000_inhibition_rules,_last_rule_matches-40            473.0 ± ∞ ¹   473.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10000_inhibition_rules,_last_rule_matches-40           481.0 ± ∞ ¹   481.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                      484.2         484.2        +0.00%
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

                                                      │ bench-before.txt │           bench-after.txt           │
                                                      │    allocs/op     │  allocs/op   vs base                │
Mutes/1_inhibition_rule,_1_inhibiting_alert-40               10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10_inhibition_rules,_1_inhibiting_alert-40             10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/100_inhibition_rules,_1_inhibiting_alert-40            10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1000_inhibition_rules,_1_inhibiting_alert-40           10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10000_inhibition_rules,_1_inhibiting_alert-40          10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_10_inhibiting_alerts-40             10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_100_inhibiting_alerts-40            10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_1000_inhibiting_alerts-40           10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1_inhibition_rule,_10000_inhibiting_alerts-40          10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/100_inhibition_rules,_1000_inhibiting_alerts-40        10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10_inhibition_rules,_last_rule_matches-40              10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/100_inhibition_rules,_last_rule_matches-40             10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1000_inhibition_rules,_last_rule_matches-40            10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10000_inhibition_rules,_last_rule_matches-40           10.00 ± ∞ ¹   10.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                      10.00         10.00        +0.00%
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

pkg: github.com/prometheus/alertmanager/matcher/parse
                │ bench-before.txt │           bench-after.txt            │
                │      sec/op      │    sec/op     vs base                │
ParseSimple-40        1.046µ ± ∞ ¹   1.096µ ± ∞ ¹       ~ (p=1.000 n=1) ²
ParseComplex-40       4.855µ ± ∞ ¹   4.769µ ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean               2.254µ         2.286µ        +1.45%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

                │ bench-before.txt │            bench-after.txt            │
                │       B/op       │     B/op       vs base                │
ParseSimple-40         232.0 ± ∞ ¹     232.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
ParseComplex-40      2.602Ki ± ∞ ¹   2.602Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                786.2           786.2        +0.00%
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

                │ bench-before.txt │           bench-after.txt           │
                │    allocs/op     │  allocs/op   vs base                │
ParseSimple-40         7.000 ± ∞ ¹   7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
ParseComplex-40        42.00 ± ∞ ¹   42.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                17.15         17.15        +0.00%
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

pkg: github.com/prometheus/alertmanager/notify
             │ bench-before.txt │         bench-after.txt         │
             │      sec/op      │    sec/op     vs base           │
HashAlert-40       239.8n ± ∞ ¹   244.2n ± ∞ ¹  ~ (p=1.000 n=1) ²
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

             │ bench-before.txt │        bench-after.txt         │
             │       B/op       │    B/op      vs base           │
HashAlert-40        72.00 ± ∞ ¹   72.00 ± ∞ ¹  ~ (p=1.000 n=1) ²
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

             │ bench-before.txt │        bench-after.txt         │
             │    allocs/op     │  allocs/op   vs base           │
HashAlert-40        2.000 ± ∞ ¹   2.000 ± ∞ ¹  ~ (p=1.000 n=1) ²
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

pkg: github.com/prometheus/alertmanager/silence
                                                                 │ bench-before.txt │            bench-after.txt            │
                                                                 │      sec/op      │    sec/op     vs base                 │
Mutes/1_silence_mutes_alert-40                                         10.50µ ± ∞ ¹   10.23µ ± ∞ ¹        ~ (p=1.000 n=1) ²
Mutes/10_silences_mute_alert-40                                        12.15µ ± ∞ ¹   13.85µ ± ∞ ¹        ~ (p=1.000 n=1) ²
Mutes/100_silences_mute_alert-40                                       35.81µ ± ∞ ¹   39.36µ ± ∞ ¹        ~ (p=1.000 n=1) ²
Mutes/1000_silences_mute_alert-40                                      430.7µ ± ∞ ¹   474.4µ ± ∞ ¹        ~ (p=1.000 n=1) ²
Mutes/10000_silences_mute_alert-40                                     5.054m ± ∞ ¹   5.211m ± ∞ ¹        ~ (p=1.000 n=1) ²
Query/100_silences-40                                                  31.09µ ± ∞ ¹
Query/1000_silences-40                                                 314.3µ ± ∞ ¹
Query/10000_silences-40                                                6.531m ± ∞ ¹
QueryParallel/100_silences,_1_goroutine-40                             38.32µ ± ∞ ¹   18.78µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/100_silences,_2_goroutines-40                            37.57µ ± ∞ ¹   17.50µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/100_silences,_4_goroutines-40                            39.29µ ± ∞ ¹   17.52µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/100_silences,_8_goroutines-40                            37.88µ ± ∞ ¹   18.83µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/1000_silences,_1_goroutine-40                           351.65µ ± ∞ ¹   46.81µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/1000_silences,_2_goroutines-40                          335.03µ ± ∞ ¹   44.99µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/1000_silences,_4_goroutines-40                          362.03µ ± ∞ ¹   46.17µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/1000_silences,_8_goroutines-40                          338.11µ ± ∞ ¹   46.33µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/10000_silences,_1_goroutine-40                          6979.9µ ± ∞ ¹   354.1µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/10000_silences,_2_goroutines-40                         6454.0µ ± ∞ ¹   363.8µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/10000_silences,_4_goroutines-40                         6607.6µ ± ∞ ¹   346.9µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/10000_silences,_8_goroutines-40                         9666.4µ ± ∞ ¹   409.3µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryWithConcurrentAdds/1000_initial_silences,_10%_add_rate-40         493.8µ ± ∞ ¹   154.1µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryWithConcurrentAdds/1000_initial_silences,_1%_add_rate-40         373.19µ ± ∞ ¹   70.64µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryWithConcurrentAdds/1000_initial_silences,_0.1%_add_rate-40       358.16µ ± ∞ ¹   49.32µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryWithConcurrentAdds/10000_initial_silences,_1%_add_rate-40        7028.4µ ± ∞ ¹   524.5µ ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryWithConcurrentAdds/10000_initial_silences,_0.1%_add_rate-40      8035.2µ ± ∞ ¹   374.5µ ± ∞ ¹        ~ (p=1.000 n=1) ²
MutesParallel/100_silences,_4_goroutines-40                            53.23µ ± ∞ ¹   39.80µ ± ∞ ¹        ~ (p=1.000 n=1) ²
MutesParallel/1000_silences,_4_goroutines-40                           484.7µ ± ∞ ¹   173.0µ ± ∞ ¹        ~ (p=1.000 n=1) ²
MutesParallel/10000_silences,_4_goroutines-40                          4.185m ± ∞ ¹   1.112m ± ∞ ¹        ~ (p=1.000 n=1) ²
MutesParallel/10000_silences,_8_goroutines-40                          4.365m ± ∞ ¹   1.077m ± ∞ ¹        ~ (p=1.000 n=1) ²
geomean                                                                451.9µ         109.5µ        -76.10%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05
³ benchmark set differs from baseline; geomeans may not be comparable

                                                                 │ bench-before.txt │            bench-after.txt            │
                                                                 │       B/op       │     B/op       vs base                │
Mutes/1_silence_mutes_alert-40                                        3.835Ki ± ∞ ¹   3.718Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10_silences_mute_alert-40                                       6.740Ki ± ∞ ¹   6.799Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/100_silences_mute_alert-40                                      35.99Ki ± ∞ ¹   35.87Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/1000_silences_mute_alert-40                                     308.2Ki ± ∞ ¹   308.1Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
Mutes/10000_silences_mute_alert-40                                    3.536Mi ± ∞ ¹   3.527Mi ± ∞ ¹       ~ (p=1.000 n=1) ²
Query/100_silences-40                                                 6.142Ki ± ∞ ¹
Query/1000_silences-40                                                41.30Ki ± ∞ ¹
Query/10000_silences-40                                               525.2Ki ± ∞ ¹
QueryParallel/100_silences,_1_goroutine-40                            6.052Ki ± ∞ ¹   6.136Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryParallel/100_silences,_2_goroutines-40                           6.048Ki ± ∞ ¹   6.049Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryParallel/100_silences,_4_goroutines-40                           6.048Ki ± ∞ ¹   6.050Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryParallel/100_silences,_8_goroutines-40                           6.053Ki ± ∞ ¹   6.039Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryParallel/1000_silences,_1_goroutine-40                           41.30Ki ± ∞ ¹   41.42Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryParallel/1000_silences,_2_goroutines-40                          41.27Ki ± ∞ ¹   41.42Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryParallel/1000_silences,_4_goroutines-40                          41.32Ki ± ∞ ¹   41.34Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryParallel/1000_silences,_8_goroutines-40                          41.29Ki ± ∞ ¹   41.44Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryParallel/10000_silences,_1_goroutine-40                          525.0Ki ± ∞ ¹   524.9Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryParallel/10000_silences,_2_goroutines-40                         524.9Ki ± ∞ ¹   524.9Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryParallel/10000_silences,_4_goroutines-40                         524.9Ki ± ∞ ¹   525.0Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryParallel/10000_silences,_8_goroutines-40                         525.0Ki ± ∞ ¹   524.9Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryWithConcurrentAdds/1000_initial_silences,_10%_add_rate-40        100.7Ki ± ∞ ¹   226.4Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryWithConcurrentAdds/1000_initial_silences,_1%_add_rate-40         61.88Ki ± ∞ ¹   86.27Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryWithConcurrentAdds/1000_initial_silences,_0.1%_add_rate-40       44.36Ki ± ∞ ¹   46.04Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryWithConcurrentAdds/10000_initial_silences,_1%_add_rate-40       1058.7Ki ± ∞ ¹   533.3Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
QueryWithConcurrentAdds/10000_initial_silences,_0.1%_add_rate-40     1118.4Ki ± ∞ ¹   525.1Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
MutesParallel/100_silences,_4_goroutines-40                           36.10Ki ± ∞ ¹   36.05Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
MutesParallel/1000_silences,_4_goroutines-40                          307.6Ki ± ∞ ¹   307.4Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
MutesParallel/10000_silences,_4_goroutines-40                         3.487Mi ± ∞ ¹   3.517Mi ± ∞ ¹       ~ (p=1.000 n=1) ²
MutesParallel/10000_silences,_8_goroutines-40                         3.492Mi ± ∞ ¹   3.514Mi ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                               94.43Ki         100.4Ki        -0.98%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05
³ benchmark set differs from baseline; geomeans may not be comparable

                                                                 │ bench-before.txt │            bench-after.txt            │
                                                                 │    allocs/op     │  allocs/op    vs base                 │
Mutes/1_silence_mutes_alert-40                                          39.00 ± ∞ ¹    39.00 ± ∞ ¹        ~ (p=1.000 n=1) ²
Mutes/10_silences_mute_alert-40                                         59.00 ± ∞ ¹    59.00 ± ∞ ¹        ~ (p=1.000 n=1) ²
Mutes/100_silences_mute_alert-40                                        158.0 ± ∞ ¹    158.0 ± ∞ ¹        ~ (p=1.000 n=1) ²
Mutes/1000_silences_mute_alert-40                                      1.071k ± ∞ ¹   1.071k ± ∞ ¹        ~ (p=1.000 n=1) ²
Mutes/10000_silences_mute_alert-40                                     10.18k ± ∞ ¹   10.10k ± ∞ ¹        ~ (p=1.000 n=1) ³
Query/100_silences-40                                                   45.00 ± ∞ ¹
Query/1000_silences-40                                                  141.0 ± ∞ ¹
Query/10000_silences-40                                                1.051k ± ∞ ¹
QueryParallel/100_silences,_1_goroutine-40                              42.00 ± ∞ ¹    42.00 ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/100_silences,_2_goroutines-40                             42.00 ± ∞ ¹    42.00 ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/100_silences,_4_goroutines-40                             42.00 ± ∞ ¹    42.00 ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/100_silences,_8_goroutines-40                             42.00 ± ∞ ¹    42.00 ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/1000_silences,_1_goroutine-40                             138.0 ± ∞ ¹    139.0 ± ∞ ¹        ~ (p=1.000 n=1) ³
QueryParallel/1000_silences,_2_goroutines-40                            138.0 ± ∞ ¹    139.0 ± ∞ ¹        ~ (p=1.000 n=1) ³
QueryParallel/1000_silences,_4_goroutines-40                            138.0 ± ∞ ¹    139.0 ± ∞ ¹        ~ (p=1.000 n=1) ³
QueryParallel/1000_silences,_8_goroutines-40                            138.0 ± ∞ ¹    139.0 ± ∞ ¹        ~ (p=1.000 n=1) ³
QueryParallel/10000_silences,_1_goroutine-40                           1.049k ± ∞ ¹   1.050k ± ∞ ¹        ~ (p=1.000 n=1) ³
QueryParallel/10000_silences,_2_goroutines-40                          1.049k ± ∞ ¹   1.049k ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryParallel/10000_silences,_4_goroutines-40                          1.049k ± ∞ ¹   1.050k ± ∞ ¹        ~ (p=1.000 n=1) ³
QueryParallel/10000_silences,_8_goroutines-40                          1.049k ± ∞ ¹   1.049k ± ∞ ¹        ~ (p=1.000 n=1) ²
QueryWithConcurrentAdds/1000_initial_silences,_10%_add_rate-40          400.0 ± ∞ ¹    876.0 ± ∞ ¹        ~ (p=1.000 n=1) ³
QueryWithConcurrentAdds/1000_initial_silences,_1%_add_rate-40           204.0 ± ∞ ¹    294.0 ± ∞ ¹        ~ (p=1.000 n=1) ³
QueryWithConcurrentAdds/1000_initial_silences,_0.1%_add_rate-40         175.0 ± ∞ ¹    162.0 ± ∞ ¹        ~ (p=1.000 n=1) ³
QueryWithConcurrentAdds/10000_initial_silences,_1%_add_rate-40         8.363k ± ∞ ¹   1.065k ± ∞ ¹        ~ (p=1.000 n=1) ³
QueryWithConcurrentAdds/10000_initial_silences,_0.1%_add_rate-40       9.138k ± ∞ ¹   1.052k ± ∞ ¹        ~ (p=1.000 n=1) ³
MutesParallel/100_silences,_4_goroutines-40                             158.0 ± ∞ ¹    158.0 ± ∞ ¹        ~ (p=1.000 n=1) ²
MutesParallel/1000_silences,_4_goroutines-40                           1.073k ± ∞ ¹   1.072k ± ∞ ¹        ~ (p=1.000 n=1) ³
MutesParallel/10000_silences,_4_goroutines-40                          10.18k ± ∞ ¹   10.10k ± ∞ ¹        ~ (p=1.000 n=1) ³
MutesParallel/10000_silences,_8_goroutines-40                          10.16k ± ∞ ¹   10.10k ± ∞ ¹        ~ (p=1.000 n=1) ³
geomean                                                                 380.8          366.0        -11.39%               ⁴
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ need >= 4 samples to detect a difference at alpha level 0.05
⁴ benchmark set differs from baseline; geomeans may not be comparable

Signed-off-by: Guido Trotter <guido@hudson-trading.com>
Signed-off-by: Guido Trotter <guido@hudson-trading.com>
…e cache

Before the silences would be in the status, but querying would result in
query errors. Now they are still in the status (since we have to
calculate after calling Merge), but we also know that some broken ones
exist.

At load snapshot time we can also avoid importing those, since they
would not be usable anyway, and we have different labels to distinguish
the cases/behaviors.

Signed-off-by: Guido Trotter <guido@hudson-trading.com>
@ultrotter ultrotter force-pushed the precompilesilencematcher branch from 602f97c to 70f47b1 Compare November 5, 2025 16:23
@ultrotter
Copy link
Contributor Author

Looks like this needs a rebase.

Done!

Copy link
Contributor

@rajagopalanand rajagopalanand left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Added just a nit comment

Signed-off-by: Guido Trotter <guido@hudson-trading.com>
@ultrotter
Copy link
Contributor Author

Overall LGTM. Added just a nit comment

Thanks! What's the comment? I only saw the suggestion for the function name, which I apply, but I can't see anything else... Is there another one? Thanks!

@rajagopalanand
Copy link
Contributor

Overall LGTM. Added just a nit comment

Thanks! What's the comment? I only saw the suggestion for the function name, which I apply, but I can't see anything else... Is there another one? Thanks!

The function name suggestion was the nit comment

Signed-off-by: Guido Trotter <guido@hudson-trading.com>
@SuperQ SuperQ merged commit 6ceb38d into prometheus:main Nov 5, 2025
7 checks passed
@ultrotter ultrotter deleted the precompilesilencematcher branch November 8, 2025 09:36
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.

4 participants