Skip to content

perf: compile simple glob patterns into string matcher variants - #2924

Merged
wolfv merged 3 commits into
conda:mainfrom
baszalmstra:perf/suffix-build-globs
Oct 12, 2026
Merged

wolfv merged 3 commits into
conda:mainfrom
baszalmstra:perf/suffix-build-globs

Conversation

@baszalmstra

@baszalmstra baszalmstra commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Compile simple globs into Any, Prefix, and Suffix variants instead of checking the pattern on every match. Complex patterns still use Glob. Adding variants breaks exhaustive matches.

Local paired benchmarks on eight build strings took 78–79% less time for prefixes and 89–91% less for suffixes than the general glob matcher. These are matcher timings, not full-solve gains.

How Has This Been Tested?

430 conda-type tests and 110 solver tests passed, including glob parity and canonical/JSON roundtrips. Cargo fmt and Clippy passed. Benchmarks used resolvo 0.12.2.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Codex

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added sufficient tests to cover my changes.

@baszalmstra baszalmstra changed the title perf: fast-path suffix build globs perf: compile simple glob patterns into string matcher variants Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

cargo-semver-checks detected API breaking changes compared with the pull request's base revision.

Details
--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_variant_added.ron

Failed in:
  variant StringMatcher:Any in /home/runner/work/rattler/rattler/crates/rattler_conda_types/src/match_spec/matcher.rs:47
  variant StringMatcher:Prefix in /home/runner/work/rattler/rattler/crates/rattler_conda_types/src/match_spec/matcher.rs:52
  variant StringMatcher:Suffix in /home/runner/work/rattler/rattler/crates/rattler_conda_types/src/match_spec/matcher.rs:55
  variant StringMatcher:Any in /home/runner/work/rattler/rattler/crates/rattler_conda_types/src/match_spec/matcher.rs:47
  variant StringMatcher:Prefix in /home/runner/work/rattler/rattler/crates/rattler_conda_types/src/match_spec/matcher.rs:52
  variant StringMatcher:Suffix in /home/runner/work/rattler/rattler/crates/rattler_conda_types/src/match_spec/matcher.rs:55
    Building rattler_conda_types v0.56.2 (current)
       Built [  19.036s] (current)
     Parsing rattler_conda_types v0.56.2 (current)
      Parsed [   0.076s] (current)
    Building rattler_conda_types v0.56.2 (baseline)
       Built [  18.775s] (baseline)
     Parsing rattler_conda_types v0.56.2 (baseline)
      Parsed [   0.076s] (baseline)
    Checking rattler_conda_types v0.56.2 -> v0.56.2 (assume minor change)
     Checked [   0.604s] 196 checks: 195 pass, 1 fail, 0 warn, 58 skip

     Summary semver requires new major version: 1 major and 0 minor checks failed
    Finished [  39.970s] rattler_conda_types

    Building rattler_solve v11.2.0 (current)
       Built [  22.888s] (current)
     Parsing rattler_solve v11.2.0 (current)
      Parsed [   0.026s] (current)
    Building rattler_solve v11.2.0 (baseline)
       Built [  22.080s] (baseline)
     Parsing rattler_solve v11.2.0 (baseline)
      Parsed [   0.027s] (baseline)
    Checking rattler_solve v11.2.0 -> v11.2.0 (assume minor change)
     Checked [   0.115s] 196 checks: 196 pass, 58 skip
     Summary no semver update required
    Finished [  46.220s] rattler_solve

@baszalmstra
baszalmstra marked this pull request as ready for review October 9, 2026 11:23
@baszalmstra
baszalmstra requested review from tdejager and wolfv October 9, 2026 11:23
@wolfv
wolfv merged commit f8e9673 into conda:main Oct 12, 2026
19 of 21 checks passed
This was referenced Oct 12, 2026
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