Perf: SourceField, PathGlobs and Filespec in rust#23244
Open
tobni wants to merge 8 commits intopantsbuild:mainfrom
Open
Perf: SourceField, PathGlobs and Filespec in rust#23244tobni wants to merge 8 commits intopantsbuild:mainfrom
tobni wants to merge 8 commits intopantsbuild:mainfrom
Conversation
d380619 to
6334dad
Compare
tobni
commented
Apr 12, 2026
| getattr(cls, "PartitionRequest"): cls._requires_snapshot for cls in _all_lint_requests() | ||
| }[type(request)] | ||
| if operates_on_paths: | ||
| return Partitions.single_partition(fs.sources.globs for fs in request.field_sets) |
Contributor
Author
There was a problem hiding this comment.
Passed tuples to something expecting strings. Pyo3 validation of types catches it.
tobni
commented
Apr 12, 2026
| #[derive(Debug)] | ||
| pub struct Globs { | ||
| strings: Box<[String]>, | ||
| py_tuple: OnceLock<Py<PyTuple>>, |
Contributor
Author
There was a problem hiding this comment.
memoizing these may be design overkill, but userland could suffer if their plugin reads globs in python and we copy to python heap every access.
tobni
commented
Apr 12, 2026
| from_py_object | ||
| )] | ||
| #[derive(Clone, Debug)] | ||
| pub struct PyFilespec { |
Contributor
Author
There was a problem hiding this comment.
This is a stylistic choice by me to make rust-coding nicer at the cost of... Something? I dont see why it should be a mutable type (dict /w lists), and the primary consumer seems to be us in FilespecMatcher - not Filespec.
I made a __getitem__ and __eq__ that ~pretends it is still a dict, increasing likelihood of backwards compat.
6334dad to
8dbcaec
Compare
8dbcaec to
f61bb10
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.