GeezerVison is showing github.com — GH-72904: Simplify implementation of `fnmatch.translate()` by barneygale · Pull Request #109879 · python/cpython
Conversation
barneygale
commented
Sep 26, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Use re to scan shell-style patterns, rather than parsing them by hand in a fat loop. This makes the code twice as slow (!) but arguably more obvious
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Use `re.Scanner` to scan shell-style patterns, rather than parsing them
by hand in a fat loop. This makes the code slower (!) but more obvious, and
lays some groundwork for a future `glob.translate()` function.
twice as slow (!)
What are the benchmarks for this? (i.e. are we talking 10μs to 20μs or 250ms to 500ms?) The regression in performance here may not matter if the translation is a sufficiently small part of any reasonable usecase.
@serhiy-storchaka has been working on re performance lately and may have tips?
A
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Withdrawing this PR - the performance isn't good enough.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
jaraco
Awaiting requested review from jaraco
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.