Skip to content

Commit de2249b

Browse files
committed
tests: Add a microbenchmark for tokenizing numeric values.
1 parent 6fe264e commit de2249b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/tests.rs

+12
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,18 @@ fn unquoted_url(b: &mut Bencher) {
632632
})
633633
}
634634

635+
636+
#[cfg(feature = "bench")]
637+
#[bench]
638+
fn numeric(b: &mut Bencher) {
639+
b.iter(|| {
640+
for _ in 0..1000000 {
641+
let mut input = Parser::new("10px");
642+
let _ = test::black_box(input.next());
643+
}
644+
})
645+
}
646+
635647
struct JsonParser;
636648

637649
#[test]

0 commit comments

Comments
 (0)