Skip to content

Delay parsing of PromQL until it's needed#1629

Merged
prymitive merged 1 commit intomainfrom
parser
Nov 24, 2025
Merged

Delay parsing of PromQL until it's needed#1629
prymitive merged 1 commit intomainfrom
parser

Conversation

@prymitive
Copy link
Collaborator

No description provided.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request was validated by pint.

✔️ No problems found

Stats

Stat Value
Version v0.77.1-21-g66868a3e
Number of rules parsed 9
Number of rules checked 9
Number of problems found 0
Number of offline checks 0
Number of online checks 0
Checks duration 0

Problems

No problems reported

@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.09%. Comparing base (f715ce3) to head (66868a3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1629      +/-   ##
==========================================
+ Coverage   97.07%   97.09%   +0.01%     
==========================================
  Files         109      109              
  Lines       13230    13248      +18     
==========================================
+ Hits        12843    12863      +20     
+ Misses        255      254       -1     
+ Partials      132      131       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Nov 24, 2025

Benchmark diff:

goos: linux
goarch: amd64
pkg: github.com/cloudflare/pint/cmd/pint
cpu: AMD EPYC 7763 64-Core Processor                
                    │   old.txt    │               new.txt               │
                    │    sec/op    │    sec/op     vs base               │
GlobFinder-4          29.28m ± ∞ ¹   18.40m ± ∞ ¹  -37.18% (p=0.008 n=5)
GitFinder-4           385.5m ± ∞ ¹   370.9m ± ∞ ¹   -3.80% (p=0.008 n=5)
CheckRules-4           9.487 ± ∞ ¹    9.475 ± ∞ ¹        ~ (p=0.548 n=5)
RuleIsIdentical-4     5.791m ± ∞ ¹   5.690m ± ∞ ¹        ~ (p=0.056 n=5)
GetChecksForEntry-4   110.9m ± ∞ ¹   106.7m ± ∞ ¹   -3.80% (p=0.016 n=5)
geomean               147.1m         131.5m        -10.62%
¹ need >= 6 samples for confidence interval at level 0.95

                    │    old.txt     │                new.txt                 │
                    │      B/op      │     B/op       vs base                 │
GlobFinder-4           8.882Mi ± ∞ ¹   7.137Mi ± ∞ ¹  -19.65% (p=0.008 n=5)
GitFinder-4            17.71Mi ± ∞ ¹   15.96Mi ± ∞ ¹   -9.89% (p=0.008 n=5)
CheckRules-4          1021.7Mi ± ∞ ¹   984.4Mi ± ∞ ¹   -3.65% (p=0.008 n=5)
RuleIsIdentical-4        0.000 ± ∞ ¹     0.000 ± ∞ ¹        ~ (p=1.000 n=5) ²
GetChecksForEntry-4    56.55Mi ± ∞ ¹   56.55Mi ± ∞ ¹   +0.00% (p=0.040 n=5)
geomean                            ³                   -6.95%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

                    │   old.txt    │                new.txt                │
                    │  allocs/op   │  allocs/op    vs base                 │
GlobFinder-4          141.0k ± ∞ ¹   111.6k ± ∞ ¹  -20.83% (p=0.008 n=5)
GitFinder-4           180.5k ± ∞ ¹   151.1k ± ∞ ¹  -16.27% (p=0.008 n=5)
CheckRules-4          14.99M ± ∞ ¹   14.70M ± ∞ ¹   -1.98% (p=0.008 n=5)
RuleIsIdentical-4      0.000 ± ∞ ¹    0.000 ± ∞ ¹        ~ (p=1.000 n=5) ²
GetChecksForEntry-4   915.8k ± ∞ ¹   915.8k ± ∞ ¹        ~ (p=0.135 n=5)
geomean                          ³                  -8.26%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

pkg: github.com/cloudflare/pint/internal/parser
        │   old.txt    │               new.txt               │
        │    sec/op    │    sec/op     vs base               │
Parse-4   27.20m ± ∞ ¹   16.45m ± ∞ ¹  -39.53% (p=0.008 n=5)
¹ need >= 6 samples for confidence interval at level 0.95

        │    old.txt    │               new.txt                │
        │     B/op      │     B/op       vs base               │
Parse-4   8.379Mi ± ∞ ¹   6.309Mi ± ∞ ¹  -24.70% (p=0.008 n=5)
¹ need >= 6 samples for confidence interval at level 0.95

        │   old.txt    │               new.txt               │
        │  allocs/op   │  allocs/op    vs base               │
Parse-4   139.4k ± ∞ ¹   103.2k ± ∞ ¹  -25.97% (p=0.008 n=5)
¹ need >= 6 samples for confidence interval at level 0.95

pkg: github.com/cloudflare/pint/internal/parser/source
               │   new.txt    │
               │    sec/op    │
LabelsSource-4   4.987m ± ∞ ¹
¹ need >= 6 samples for confidence interval at level 0.95

               │    new.txt    │
               │     B/op      │
LabelsSource-4   4.082Mi ± ∞ ¹
¹ need >= 6 samples for confidence interval at level 0.95

               │   new.txt    │
               │  allocs/op   │
LabelsSource-4   33.54k ± ∞ ¹
¹ need >= 6 samples for confidence interval at level 0.95

pkg: github.com/cloudflare/pint/internal/parser/utils
               │   old.txt    │
               │    sec/op    │
LabelsSource-4   5.055m ± ∞ ¹
¹ need >= 6 samples for confidence interval at level 0.95

               │    old.txt    │
               │     B/op      │
LabelsSource-4   4.084Mi ± ∞ ¹
¹ need >= 6 samples for confidence interval at level 0.95

               │   old.txt    │
               │  allocs/op   │
LabelsSource-4   33.54k ± ∞ ¹
¹ need >= 6 samples for confidence interval at level 0.95

pkg: github.com/cloudflare/pint/internal/promapi
                    │   old.txt    │              new.txt               │
                    │    sec/op    │    sec/op     vs base              │
QueryCacheOnlySet-4   102.7n ± ∞ ¹   102.3n ± ∞ ¹       ~ (p=0.349 n=5)
QueryCacheSetGrow-4   401.9n ± ∞ ¹   385.7n ± ∞ ¹       ~ (p=0.690 n=5)
QueryCacheGetMiss-4   16.31n ± ∞ ¹   16.31n ± ∞ ¹       ~ (p=0.500 n=5)
QueryCacheGC/0%-4     33.92µ ± ∞ ¹   33.66µ ± ∞ ¹       ~ (p=0.095 n=5)
QueryCacheGC/1%-4     34.97µ ± ∞ ¹   34.09µ ± ∞ ¹  -2.52% (p=0.016 n=5)
QueryCacheGC/10%-4    39.15µ ± ∞ ¹   38.46µ ± ∞ ¹  -1.76% (p=0.008 n=5)
QueryCacheGC/20%-4    67.27µ ± ∞ ¹   66.89µ ± ∞ ¹  -0.57% (p=0.032 n=5)
QueryCacheGC/25%-4    67.29µ ± ∞ ¹   66.62µ ± ∞ ¹  -0.99% (p=0.008 n=5)
QueryCacheGC/50%-4    65.29µ ± ∞ ¹   65.34µ ± ∞ ¹       ~ (p=0.841 n=5)
QueryCacheGC/75%-4    50.03µ ± ∞ ¹   49.68µ ± ∞ ¹       ~ (p=0.421 n=5)
QueryCacheGC/99%-4    50.01µ ± ∞ ¹   49.20µ ± ∞ ¹       ~ (p=0.222 n=5)
QueryCacheGC/100%-4   50.07µ ± ∞ ¹   50.05µ ± ∞ ¹       ~ (p=1.000 n=5)
geomean               10.12µ         10.01µ        -1.12%
¹ need >= 6 samples for confidence interval at level 0.95

                    │    old.txt    │                new.txt                │
                    │     B/op      │     B/op       vs base                │
QueryCacheOnlySet-4     64.00 ± ∞ ¹     64.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheSetGrow-4     124.0 ± ∞ ¹     136.0 ± ∞ ¹       ~ (p=0.095 n=5)
QueryCacheGetMiss-4     0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/0%-4       0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/1%-4       0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/10%-4      0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/20%-4    18.09Ki ± ∞ ¹   18.09Ki ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/25%-4    18.09Ki ± ∞ ¹   18.09Ki ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/50%-4    18.09Ki ± ∞ ¹   18.09Ki ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/75%-4      48.00 ± ∞ ¹     48.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/99%-4      48.00 ± ∞ ¹     48.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/100%-4     48.00 ± ∞ ¹     48.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
geomean                           ³                  +0.77%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

                    │   old.txt   │               new.txt               │
                    │  allocs/op  │  allocs/op   vs base                │
QueryCacheOnlySet-4   1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheSetGrow-4   1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGetMiss-4   0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/0%-4     0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/1%-4     0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/10%-4    0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/20%-4    4.000 ± ∞ ¹   4.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/25%-4    4.000 ± ∞ ¹   4.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/50%-4    4.000 ± ∞ ¹   4.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/75%-4    1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/99%-4    1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
QueryCacheGC/100%-4   1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
geomean                         ³                +0.00%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

@prymitive prymitive merged commit e31cae6 into main Nov 24, 2025
21 checks passed
@prymitive prymitive deleted the parser branch November 24, 2025 12:14
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