Skip to content

Commit cd5b0e8

Browse files
committed
Fix benchmark build, update changelog and bump version.
1 parent 634f4d0 commit cd5b0e8

File tree

3 files changed

+49
-14
lines changed

3 files changed

+49
-14
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
9+
## [0.21.0] - 2025-10-04
810
### Added
911
- `ParsingOptions::entity_resolver` can be used to resolve external entities referenced via public ID and URI.
1012

1113
### Changed
12-
- `Node::has_attribute`, `Node::attribute` and `Node::attribute_node` now match local names similar to how `Node::has_tag_name` works.
14+
- `Node::has_attribute`, `Node::attribute` and `Node::attribute_node` match local names similar to how `Node::has_tag_name` works.
15+
- Various internal performance improvements, e.g. devirtualization of token dispatch and usage of `memchr` for finding delimiters.
16+
17+
### Fixed
18+
- Possible panic when entity resolution yields unbalanced tags.
19+
- Quadratic runtime when merging consecutive text nodes.
1320

1421
## [0.20.0] - 2024-05-23
1522
### Added

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "roxmltree"
3-
version = "0.20.0"
3+
version = "0.21.0"
44
authors = ["Yevhenii Reizner <[email protected]>"]
55
keywords = ["xml", "parser", "tree", "dom"]
66
categories = ["parser-implementations"]

benches/xml.rs

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,16 @@ fn huge_quick_xml(bencher: &mut Bencher) {
7878

7979
fn tiny_roxmltree(bencher: &mut Bencher) {
8080
let text = std::fs::read_to_string("fonts.conf").unwrap();
81-
let mut opt = roxmltree::ParsingOptions::default();
82-
opt.allow_dtd = true;
83-
bencher.iter(|| roxmltree::Document::parse_with_options(&text, opt).unwrap())
81+
bencher.iter(|| {
82+
roxmltree::Document::parse_with_options(
83+
&text,
84+
roxmltree::ParsingOptions {
85+
allow_dtd: true,
86+
..Default::default()
87+
},
88+
)
89+
.unwrap()
90+
})
8491
}
8592

8693
fn medium_roxmltree(bencher: &mut Bencher) {
@@ -100,9 +107,16 @@ fn huge_roxmltree(bencher: &mut Bencher) {
100107

101108
fn gigantic_roxmltree(bencher: &mut Bencher) {
102109
let text = std::fs::read_to_string("gigantic.svg").unwrap();
103-
let mut opt = roxmltree::ParsingOptions::default();
104-
opt.allow_dtd = true;
105-
bencher.iter(|| roxmltree::Document::parse_with_options(&text, opt).unwrap())
110+
bencher.iter(|| {
111+
roxmltree::Document::parse_with_options(
112+
&text,
113+
roxmltree::ParsingOptions {
114+
allow_dtd: true,
115+
..Default::default()
116+
},
117+
)
118+
.unwrap()
119+
})
106120
}
107121

108122
fn cdata_roxmltree(bencher: &mut Bencher) {
@@ -112,16 +126,30 @@ fn cdata_roxmltree(bencher: &mut Bencher) {
112126

113127
fn text_roxmltree(bencher: &mut Bencher) {
114128
let text = std::fs::read_to_string("text.xml").unwrap();
115-
let mut opt = roxmltree::ParsingOptions::default();
116-
opt.allow_dtd = true;
117-
bencher.iter(|| roxmltree::Document::parse_with_options(&text, opt).unwrap())
129+
bencher.iter(|| {
130+
roxmltree::Document::parse_with_options(
131+
&text,
132+
roxmltree::ParsingOptions {
133+
allow_dtd: true,
134+
..Default::default()
135+
},
136+
)
137+
.unwrap()
138+
})
118139
}
119140

120141
fn attributes_roxmltree(bencher: &mut Bencher) {
121142
let text = std::fs::read_to_string("attributes.xml").unwrap();
122-
let mut opt = roxmltree::ParsingOptions::default();
123-
opt.allow_dtd = true;
124-
bencher.iter(|| roxmltree::Document::parse_with_options(&text, opt).unwrap())
143+
bencher.iter(|| {
144+
roxmltree::Document::parse_with_options(
145+
&text,
146+
roxmltree::ParsingOptions {
147+
allow_dtd: true,
148+
..Default::default()
149+
},
150+
)
151+
.unwrap()
152+
})
125153
}
126154

127155
fn tiny_xmltree(bencher: &mut Bencher) {

0 commit comments

Comments
 (0)