Skip to content

Commit 57f8476

Browse files
committed
Add scaffolding for html5ever-0.26.0.
Overall compile times: ``` html5ever html5ever-0.26.0 check 4.1s 7.8s debug 4.4s 8.0s opt 4.7s 7.3s ``` Compile times for the final crate: ``` helloworld html5ever html5ever-0.26.0 check 0.16 1.10 0.58 debug 0.23 1.37 0.69 opt 0.22 1.65 0.81 ``` The final crate is quite a bit smaller, especially relative to the overall time. I looked at Cachegrind profiles, it seems like html5ever-0.26.0 is even more of a macro expanstion + AST handling stress test, because that stuff is a bigger proportion. So I think it's still reasonable to include it.
1 parent fcee096 commit 57f8476

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

collector/benchmarks/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ They mostly consist of real-world crates.
2727
types.
2828
- **helloworld**: A trivial program. Gives a lower bound on compile time.
2929
- **html5ever**: An HTML parser. Stresses macro parsing code significantly.
30+
- **html5ever-0.26.0**: An HTML parser. Stresses macro parsing code.
3031
- **hyper-2**: A fairly large crate. Utilizes async/await, and used by
3132
many Rust programs.
3233
- **hyper-0.14.18**: A fairly large crate. Utilizes async/await, and used by
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/src/util/str.rs b/src/util/str.rs
2+
index 756a88d2..2801f859 100644
3+
--- a/src/util/str.rs
4+
+++ b/src/util/str.rs
5+
@@ -10,6 +10,8 @@
6+
use std::fmt;
7+
8+
pub fn to_escaped_string<T: fmt::Debug>(x: &T) -> String {
9+
+ println!("testing");
10+
+
11+
// FIXME: don't allocate twice
12+
let string = format!("{:?}", x);
13+
string.chars().flat_map(|c| c.escape_default()).collect()

collector/benchmarks/html5ever-0.26.0/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ version = "1"
4545
features = ["extra-traits", "full", "fold"]
4646
[target."cfg(bench)".dev-dependencies.criterion]
4747
version = "0.3"
48+
49+
[workspace]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
"touch_file": "src/lib.rs",
23
"category": "primary"
34
}

0 commit comments

Comments
 (0)