[ty] Speed up include filtering for projects with many literal include patterns by dhimasardinata · Pull Request #25266 · astral-sh/ruff (original) (raw)

@dhimasardinata

@MichaReiser MichaReiser changed the title[ty] perf: speed up include literal matching [ty] Speed up include filtering for projects with many literal include patterns

May 20, 2026

@MichaReiser

thejchap pushed a commit to thejchap/ruff that referenced this pull request

May 23, 2026

…e patterns (astral-sh#25266)

Summary

Benchmark

Command:

cargo bench -p ruff_benchmark --bench ty --no-default-features --features ty_instrumented ty_include_filter -- --sample-size 10

Results:

This is about 1.46x faster, or a 31.7% reduction in time per literal include match in this benchmark.

Test Plan

Refs astral-sh#25244


Co-authored-by: Micha Reiser micha@reiser.io

anishgirianish pushed a commit to anishgirianish/ruff that referenced this pull request

May 28, 2026

…e patterns (astral-sh#25266)

Summary

Benchmark

Command:

cargo bench -p ruff_benchmark --bench ty --no-default-features --features ty_instrumented ty_include_filter -- --sample-size 10

Results:

This is about 1.46x faster, or a 31.7% reduction in time per literal include match in this benchmark.

Test Plan

Refs astral-sh#25244


Co-authored-by: Micha Reiser micha@reiser.io

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})