Update Rust crate quick-xml to 0.40#2121
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2121 +/- ##
=======================================
Coverage 92.36% 92.36%
=======================================
Files 121 121
Lines 24847 24847
=======================================
Hits 22951 22951
Misses 1896 1896 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: -0.76% (26.3 MiB → 26.1 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
⚡️ Hyperfine BenchmarksSummary: 0 regressions, 1 improvements above the 10% threshold. Environment
CLI CommandsBenchmarking basic commands in the main repo:
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base --version |
2.3 ± 0.1 | 2.1 | 3.0 | 1.03 ± 0.07 |
prek-head --version |
2.2 ± 0.1 | 2.1 | 2.5 | 1.00 |
prek list
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base list |
8.9 ± 0.2 | 8.6 | 9.7 | 1.01 ± 0.03 |
prek-head list |
8.8 ± 0.1 | 8.6 | 9.2 | 1.00 |
prek validate-config .pre-commit-config.yaml
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base validate-config .pre-commit-config.yaml |
2.9 ± 0.0 | 2.8 | 3.0 | 1.01 ± 0.02 |
prek-head validate-config .pre-commit-config.yaml |
2.9 ± 0.1 | 2.8 | 3.1 | 1.00 |
prek sample-config
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base sample-config |
2.4 ± 0.0 | 2.3 | 2.5 | 1.00 |
prek-head sample-config |
2.4 ± 0.0 | 2.3 | 2.5 | 1.01 ± 0.03 |
Cold vs Warm Runs
Comparing first run (cold) vs subsequent runs (warm cache):
prek run --all-files (cold - no cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
78.9 ± 3.4 | 74.1 | 85.6 | 1.00 ± 0.06 |
prek-head run --all-files |
78.6 ± 2.9 | 74.4 | 83.6 | 1.00 |
prek run --all-files (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
78.4 ± 2.3 | 74.5 | 83.8 | 1.00 |
prek-head run --all-files |
79.4 ± 2.2 | 75.6 | 84.7 | 1.01 ± 0.04 |
Full Hook Suite
Running the builtin hook suite on the benchmark workspace:
prek run --all-files (full builtin hook suite)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
79.4 ± 3.2 | 74.1 | 91.4 | 1.00 |
prek-head run --all-files |
81.5 ± 3.4 | 75.9 | 90.0 | 1.03 ± 0.06 |
Individual Hook Performance
Benchmarking each hook individually on the test repo:
prek run trailing-whitespace --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run trailing-whitespace --all-files |
20.8 ± 0.5 | 19.9 | 22.5 | 1.00 ± 0.03 |
prek-head run trailing-whitespace --all-files |
20.7 ± 0.4 | 19.8 | 21.5 | 1.00 |
prek run end-of-file-fixer --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run end-of-file-fixer --all-files |
26.4 ± 1.6 | 24.4 | 30.8 | 1.00 |
prek-head run end-of-file-fixer --all-files |
27.2 ± 2.2 | 24.0 | 31.7 | 1.03 ± 0.10 |
prek run check-json --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-json --all-files |
8.3 ± 0.3 | 7.8 | 9.0 | 1.06 ± 0.06 |
prek-head run check-json --all-files |
7.8 ± 0.3 | 7.2 | 8.7 | 1.00 |
prek run check-yaml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-yaml --all-files |
7.7 ± 0.2 | 7.4 | 8.3 | 1.01 ± 0.04 |
prek-head run check-yaml --all-files |
7.6 ± 0.1 | 7.4 | 7.9 | 1.00 |
prek run check-toml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-toml --all-files |
7.7 ± 0.3 | 7.2 | 8.3 | 1.00 |
prek-head run check-toml --all-files |
7.8 ± 0.3 | 7.2 | 8.3 | 1.02 ± 0.05 |
prek run check-xml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-xml --all-files |
7.8 ± 0.3 | 7.3 | 8.6 | 1.01 ± 0.05 |
prek-head run check-xml --all-files |
7.7 ± 0.3 | 7.1 | 8.5 | 1.00 |
prek run detect-private-key --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run detect-private-key --all-files |
13.5 ± 1.2 | 11.6 | 16.5 | 1.00 |
prek-head run detect-private-key --all-files |
13.7 ± 1.1 | 11.8 | 16.2 | 1.01 ± 0.12 |
prek run fix-byte-order-marker --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run fix-byte-order-marker --all-files |
22.2 ± 1.3 | 19.1 | 24.5 | 1.00 |
prek-head run fix-byte-order-marker --all-files |
23.0 ± 1.7 | 19.9 | 26.3 | 1.04 ± 0.10 |
Installation Performance
Benchmarking hook installation (fast path hooks skip Python setup):
prek install-hooks (cold - no cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
4.7 ± 0.2 | 4.5 | 4.9 | 1.02 ± 0.06 |
prek-head install-hooks |
4.6 ± 0.2 | 4.4 | 4.8 | 1.00 |
prek install-hooks (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
4.5 ± 0.0 | 4.4 | 4.5 | 1.01 ± 0.01 |
prek-head install-hooks |
4.4 ± 0.0 | 4.4 | 4.5 | 1.00 |
File Filtering/Scoping Performance
Testing different file selection modes:
prek run (staged files only)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run |
38.0 ± 0.9 | 36.9 | 39.5 | 1.00 |
prek-head run |
38.1 ± 1.2 | 36.2 | 40.5 | 1.00 ± 0.04 |
prek run --files '*.json' (specific file type)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --files '*.json' |
8.2 ± 0.6 | 7.7 | 9.9 | 1.00 |
prek-head run --files '*.json' |
8.4 ± 1.0 | 7.7 | 11.0 | 1.02 ± 0.15 |
Workspace Discovery & Initialization
Benchmarking hook discovery and initialization overhead:
prek run --dry-run --all-files (measures init overhead)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --dry-run --all-files |
29.7 ± 75.7 | 6.9 | 344.9 | 4.28 ± 10.91 |
prek-head run --dry-run --all-files |
6.9 ± 0.1 | 6.8 | 7.1 | 1.00 |
✅ Performance improvement for prek run --dry-run --all-files (measures init overhead): 76.6600% faster
Meta Hooks Performance
Benchmarking meta hooks separately:
prek run check-hooks-apply --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-hooks-apply --all-files |
12.4 ± 2.0 | 11.7 | 19.6 | 1.04 ± 0.17 |
prek-head run check-hooks-apply --all-files |
11.9 ± 0.1 | 11.8 | 12.2 | 1.00 |
prek run check-useless-excludes --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-useless-excludes --all-files |
10.9 ± 0.2 | 10.7 | 11.4 | 1.02 ± 0.02 |
prek-head run check-useless-excludes --all-files |
10.7 ± 0.1 | 10.6 | 10.8 | 1.00 |
prek run identity --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run identity --all-files |
9.7 ± 0.1 | 9.5 | 10.0 | 1.00 |
prek-head run identity --all-files |
9.8 ± 0.1 | 9.5 | 9.9 | 1.01 ± 0.02 |
This PR contains the following updates:
0.39→0.40Release Notes
tafia/quick-xml (quick-xml)
v0.40.1Compare Source
Bug Fixes
unreachable!()panic in the serde deserializer when a DOCTYPEdeclaration appears between two text runs inside an element (e.g.
<a>x<!DOCTYPE y>z</a>). The DOCTYPE used to breakdrain_text'sconsecutive-text merge, so two
DeEvent::Textevents reachedread_textand tripped its "Cannot be two consequent Text events"invariant. DOCTYPE is now treated as transparent during text drain —
it still goes through the entity resolver, but the surrounding text
is merged into one run. Discovered via libFuzzer on a real-world
SAML deserializer harness.
Misc Changes
v0.40.0Compare Source
MSRV bumped to 1.79.
Now
quick-xmlsupports the UTF-16 encoded documents. See the newDecodingReadertype.New Features
#956: Add
DecodingReader, aBufReadadapter that auto-detects encodingfrom BOM or XML declaration and transcodes to UTF-8. Enabled by the
encodingfeature.#938: Add new enumeration
XmlVersionand typified getterBytesDecl::xml_version().#938: Add new error variant
IllFormedError::UnknownVersion.#371: Add new error variant
EscapeError::TooManyNestedEntities.#371: Improved compliance with the XML attribute value normalization process by adding
Attribute::normalized_value()Attribute::normalized_value_with()Attribute::decoded_and_normalized_value()Attribute::decoded_and_normalized_value_with()which ought to be used in place of deprecated
Attribute::unescape_value()Attribute::unescape_value_with()Attribute::decode_and_unescape_value()Attribute::decode_and_unescape_value_with()Deprecated functions now behaves the same as newly added.
Bug Fixes
Deserializerwhen parse XML 1.0 documents.Previously XML 1.1. rules was applied.
Misc Changes
.prefixes(),.resolve(),.resolve_attribute(), and.resolve_element()of
NsReader. Use.resolver().<...>methods instead.BytesText::xml_content,BytesCData::xml_contentandBytesRef::xml_contentaccepts
XmlVersionparameter to apply correct EOL normalization rules.read_text()now returnsBytesTextwhich allows you to get the content withproperly normalized EOLs. To get the previous behavior use
.read_text().decode()?.Configuration
📅 Schedule: (UTC)
* 0-3 * * 1)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.