perf: use lazy-initialized regexes instead of per-call compilation#3071
Merged
Conversation
Convert all Regex::new() calls that were compiled on every function invocation to use once_cell::sync::Lazy statics: - develop/mod.rs: parse_direct_url_path() - 2 regexes - develop/install_backend.rs: version() - pip/uv version regexes - metadata.rs: get_distribution_escaped() - upload.rs: canonicalize_name() and upload_ui() title regex - new_project.rs: pypi_check_name() - auditwheel/musllinux.rs: get_musl_version() - python_interpreter/discovery.rs: Windows py launcher and conda parsers - target/platform_tag.rs: Android API level detection
bmwiedemann
pushed a commit
to bmwiedemann/openSUSE
that referenced
this pull request
Apr 14, 2026
https://build.opensuse.org/request/show/1346282 by user mia + dimstar_suse - Update to version 1.13.1 * fix: fall back to placeholder for abi3 when found interpreters are too old gh#PyO3/maturin#3126 - Changes in version 1.13.0: * Sync legacy_py.rs with upstream PyPI warehouse legacy.py gh#PyO3/maturin#3053 * Fix --strip conflicting with --include-debuginfo in develop gh#PyO3/maturin#3057 * Fix abi3 wheel producing version-specific tags for CPython below minimum gh#PyO3/maturin#3061 * Fix data symlink permission handling gh#PyO3/maturin#3069 * fix: correct bugs in audit.rs typo and module_writer gh#PyO3/maturin#3070 * perf: use lazy-initialized regexes instead of per-call compilation gh#PyO3/maturin#3071 * fix: skip legacy manylinux aliases not in PyPI allow-list gh#PyO3/maturin#3078 * fix: auto-generat
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.
Convert all
Regex::new()calls that were compiled on every function invocation to useonce_cell::sync::Lazystatics.