Skip to content

Commit

Permalink
perf(es/lexer): Apply various optimizations (#9095)
Browse files Browse the repository at this point in the history
**Description:**

- `TokenContexts` now uses smallvec, as the element type is very small (1 byte) now.
 - Some codes are moved to allow CPU to cache code correctly.
  • Loading branch information
kdy1 authored Jun 21, 2024
1 parent 8dbcb50 commit 2f02630
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 117 deletions.
1 change: 1 addition & 0 deletions crates/swc_ecma_parser/src/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,7 @@ impl<'a> Lexer<'a> {
Ok(Token::Regex(content, flags))
}

#[cold]
fn read_shebang(&mut self) -> LexResult<Option<Atom>> {
if self.input.cur() != Some('#') || self.input.peek() != Some('!') {
return Ok(None);
Expand Down
237 changes: 121 additions & 116 deletions crates/swc_ecma_parser/src/lexer/state.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::mem::take;

use smallvec::{smallvec, SmallVec};
use swc_common::{BytePos, Span};
use tracing::trace;

Expand Down Expand Up @@ -192,145 +193,149 @@ impl Tokens for Lexer<'_> {
}
}

impl<'a> Iterator for Lexer<'a> {
type Item = TokenAndSpan;

fn next(&mut self) -> Option<Self::Item> {
let mut start = self.cur_pos();

let res = (|| -> Result<Option<_>, _> {
if let Some(start) = self.state.next_regexp {
return Ok(Some(self.read_regexp(start)?));
}
impl Lexer<'_> {
fn next_token(&mut self, start: &mut BytePos) -> Result<Option<Token>, Error> {
if let Some(start) = self.state.next_regexp {
return Ok(Some(self.read_regexp(start)?));
}

if self.state.is_first {
if let Some(shebang) = self.read_shebang()? {
return Ok(Some(Token::Shebang(shebang)));
}
if self.state.is_first {
if let Some(shebang) = self.read_shebang()? {
return Ok(Some(Token::Shebang(shebang)));
}
}

self.state.had_line_break = self.state.is_first;
self.state.is_first = false;
self.state.had_line_break = self.state.is_first;
self.state.is_first = false;

// skip spaces before getting next character, if we are allowed to.
if self.state.can_skip_space() {
self.skip_space::<true>()?;
start = self.input.cur_pos();
};
// skip spaces before getting next character, if we are allowed to.
if self.state.can_skip_space() {
self.skip_space::<true>()?;
*start = self.input.cur_pos();
};

match self.input.cur() {
Some(..) => {}
// End of input.
None => {
if let Some(comments) = self.comments.as_mut() {
let comments_buffer = self.comments_buffer.as_mut().unwrap();
let last = self.state.prev_hi;

// move the pending to the leading or trailing
for c in comments_buffer.take_pending_leading() {
// if the file had no tokens and no shebang, then treat any
// comments in the leading comments buffer as leading.
// Otherwise treat them as trailing.
if last == self.start_pos {
comments_buffer.push(BufferedComment {
kind: BufferedCommentKind::Leading,
pos: last,
comment: c,
});
} else {
comments_buffer.push(BufferedComment {
kind: BufferedCommentKind::Trailing,
pos: last,
comment: c,
});
}
match self.input.cur() {
Some(..) => {}
// End of input.
None => {
if let Some(comments) = self.comments.as_mut() {
let comments_buffer = self.comments_buffer.as_mut().unwrap();
let last = self.state.prev_hi;

// move the pending to the leading or trailing
for c in comments_buffer.take_pending_leading() {
// if the file had no tokens and no shebang, then treat any
// comments in the leading comments buffer as leading.
// Otherwise treat them as trailing.
if last == self.start_pos {
comments_buffer.push(BufferedComment {
kind: BufferedCommentKind::Leading,
pos: last,
comment: c,
});
} else {
comments_buffer.push(BufferedComment {
kind: BufferedCommentKind::Trailing,
pos: last,
comment: c,
});
}
}

// now fill the user's passed in comments
for comment in comments_buffer.take_comments() {
match comment.kind {
BufferedCommentKind::Leading => {
comments.add_leading(comment.pos, comment.comment);
}
BufferedCommentKind::Trailing => {
comments.add_trailing(comment.pos, comment.comment);
}
// now fill the user's passed in comments
for comment in comments_buffer.take_comments() {
match comment.kind {
BufferedCommentKind::Leading => {
comments.add_leading(comment.pos, comment.comment);
}
BufferedCommentKind::Trailing => {
comments.add_trailing(comment.pos, comment.comment);
}
}
}

return Ok(None);
}
};

// println!(
// "\tContext: ({:?}) {:?}",
// self.input.cur().unwrap(),
// self.state.context.0
// );

self.state.start = start;
return Ok(None);
}
};

if self.syntax.jsx() && !self.ctx.in_property_name && !self.ctx.in_type {
//jsx
if self.state.context.current() == Some(TokenContext::JSXExpr) {
return self.read_jsx_token();
}
// println!(
// "\tContext: ({:?}) {:?}",
// self.input.cur().unwrap(),
// self.state.context.0
// );

let c = self.cur();
if let Some(c) = c {
if self.state.context.current() == Some(TokenContext::JSXOpeningTag)
|| self.state.context.current() == Some(TokenContext::JSXClosingTag)
{
if c.is_ident_start() {
return self.read_jsx_word().map(Some);
}
self.state.start = *start;

if c == '>' {
unsafe {
// Safety: cur() is Some('>')
self.input.bump();
}
return Ok(Some(Token::JSXTagEnd));
}
if self.syntax.jsx() && !self.ctx.in_property_name && !self.ctx.in_type {
//jsx
if self.state.context.current() == Some(TokenContext::JSXExpr) {
return self.read_jsx_token();
}

if (c == '\'' || c == '"')
&& self.state.context.current() == Some(TokenContext::JSXOpeningTag)
{
return self.read_jsx_str(c).map(Some);
}
let c = self.cur();
if let Some(c) = c {
if self.state.context.current() == Some(TokenContext::JSXOpeningTag)
|| self.state.context.current() == Some(TokenContext::JSXClosingTag)
{
if c.is_ident_start() {
return self.read_jsx_word().map(Some);
}

if c == '<' && self.state.is_expr_allowed && self.input.peek() != Some('!') {
let had_line_break_before_last = self.had_line_break_before_last();
let cur_pos = self.input.cur_pos();

if c == '>' {
unsafe {
// Safety: cur() is Some('<')
// Safety: cur() is Some('>')
self.input.bump();
}
return Ok(Some(Token::JSXTagEnd));
}

if had_line_break_before_last && self.is_str("<<<<<< ") {
let span = Span::new(cur_pos, cur_pos + BytePos(7), Default::default());
if (c == '\'' || c == '"')
&& self.state.context.current() == Some(TokenContext::JSXOpeningTag)
{
return self.read_jsx_str(c).map(Some);
}
}

self.emit_error_span(span, SyntaxError::TS1185);
self.skip_line_comment(6);
self.skip_space::<true>()?;
return self.read_token();
}
if c == '<' && self.state.is_expr_allowed && self.input.peek() != Some('!') {
let had_line_break_before_last = self.had_line_break_before_last();
let cur_pos = self.input.cur_pos();

unsafe {
// Safety: cur() is Some('<')
self.input.bump();
}

if had_line_break_before_last && self.is_str("<<<<<< ") {
let span = Span::new(cur_pos, cur_pos + BytePos(7), Default::default());

return Ok(Some(Token::JSXTagStart));
self.emit_error_span(span, SyntaxError::TS1185);
self.skip_line_comment(6);
self.skip_space::<true>()?;
return self.read_token();
}

return Ok(Some(Token::JSXTagStart));
}
}
}

if let Some(TokenContext::Tpl {}) = self.state.context.current() {
let start = self.state.tpl_start;
return self.read_tmpl_token(start).map(Some);
}
if let Some(TokenContext::Tpl {}) = self.state.context.current() {
let start = self.state.tpl_start;
return self.read_tmpl_token(start).map(Some);
}

self.read_token()
}
}

impl<'a> Iterator for Lexer<'a> {
type Item = TokenAndSpan;

fn next(&mut self) -> Option<Self::Item> {
let mut start = self.cur_pos();

self.read_token()
})();
let res = self.next_token(&mut start);

let token = match res.map_err(Token::Error).map_err(Some) {
Ok(t) => t,
Expand Down Expand Up @@ -367,7 +372,7 @@ impl<'a> Iterator for Lexer<'a> {

impl State {
pub fn new(syntax: Syntax, start_pos: BytePos) -> Self {
let context = TokenContexts(vec![TokenContext::BraceStmt]);
let context = TokenContexts(smallvec![TokenContext::BraceStmt]);

State {
is_expr_allowed: true,
Expand Down Expand Up @@ -642,7 +647,7 @@ impl State {
}

#[derive(Clone, Default)]
pub struct TokenContexts(pub(crate) Vec<TokenContext>);
pub struct TokenContexts(pub(crate) SmallVec<[TokenContext; 32]>);

impl TokenContexts {
/// Returns true if following `LBrace` token is `block statement` according
Expand Down Expand Up @@ -783,7 +788,7 @@ impl TokenContext {
Self::BraceExpr
| Self::TplQuasi
| Self::ParenExpr
| Self::Tpl { .. }
| Self::Tpl
| Self::FnExpr
| Self::ClassExpr
| Self::JSXExpr
Expand All @@ -792,7 +797,7 @@ impl TokenContext {

pub(crate) const fn preserve_space(&self) -> bool {
match self {
Self::Tpl { .. } | Self::JSXExpr => true,
Self::Tpl | Self::JSXExpr => true,
_ => false,
}
}
Expand All @@ -813,9 +818,9 @@ where
let res = f(&mut l);

#[cfg(debug_assertions)]
let c = vec![TokenContext::BraceStmt];
let c = TokenContexts(smallvec![TokenContext::BraceStmt]);
#[cfg(debug_assertions)]
debug_assert_eq!(l.state.context.0, c);
debug_assert_eq!(l.state.context.0, c.0);

res
})
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_parser/src/parser/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2771,7 +2771,7 @@ impl<I: Tokens> Parser<I> {
let cloned = self.input.token_context().clone();

self.input
.set_token_context(TokenContexts(vec![cloned.0[0]]));
.set_token_context(TokenContexts(smallvec::smallvec![cloned.0[0]]));
let res = op(self);
self.input.set_token_context(cloned);

Expand Down

1 comment on commit 2f02630

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 2f02630 Previous: 5520b23 Ratio
es/full/bugs-1 275137 ns/iter (± 12496) 276710 ns/iter (± 7061) 0.99
es/full/minify/libraries/antd 1788361702 ns/iter (± 43097383) 1780984028 ns/iter (± 67656584) 1.00
es/full/minify/libraries/d3 342407938 ns/iter (± 1332477) 346018516 ns/iter (± 1650023) 0.99
es/full/minify/libraries/echarts 1467396343 ns/iter (± 17764275) 1496522888 ns/iter (± 32183365) 0.98
es/full/minify/libraries/jquery 102494026 ns/iter (± 387743) 102778307 ns/iter (± 521145) 1.00
es/full/minify/libraries/lodash 113400128 ns/iter (± 178628) 114148784 ns/iter (± 435413) 0.99
es/full/minify/libraries/moment 59382019 ns/iter (± 1698822) 60083888 ns/iter (± 307513) 0.99
es/full/minify/libraries/react 18302951 ns/iter (± 19535) 18288193 ns/iter (± 54335) 1.00
es/full/minify/libraries/terser 273991635 ns/iter (± 5863190) 277440320 ns/iter (± 1623179) 0.99
es/full/minify/libraries/three 464956994 ns/iter (± 1768558) 480089487 ns/iter (± 3765702) 0.97
es/full/minify/libraries/typescript 3226920857 ns/iter (± 23769464) 3240085413 ns/iter (± 39482255) 1.00
es/full/minify/libraries/victory 714670228 ns/iter (± 5938056) 721145115 ns/iter (± 4769239) 0.99
es/full/minify/libraries/vue 144317770 ns/iter (± 361907) 145479993 ns/iter (± 1008434) 0.99
es/full/codegen/es3 59707 ns/iter (± 181) 60743 ns/iter (± 241) 0.98
es/full/codegen/es5 59725 ns/iter (± 97) 61470 ns/iter (± 372) 0.97
es/full/codegen/es2015 59478 ns/iter (± 137) 61306 ns/iter (± 514) 0.97
es/full/codegen/es2016 59503 ns/iter (± 423) 60830 ns/iter (± 357) 0.98
es/full/codegen/es2017 59492 ns/iter (± 152) 60949 ns/iter (± 307) 0.98
es/full/codegen/es2018 59708 ns/iter (± 3181) 61183 ns/iter (± 224) 0.98
es/full/codegen/es2019 59261 ns/iter (± 106) 60714 ns/iter (± 414) 0.98
es/full/codegen/es2020 59435 ns/iter (± 168) 61085 ns/iter (± 370) 0.97
es/full/all/es3 160724023 ns/iter (± 899639) 162662431 ns/iter (± 1609064) 0.99
es/full/all/es5 155661706 ns/iter (± 1700472) 157264625 ns/iter (± 616847) 0.99
es/full/all/es2015 114319160 ns/iter (± 681772) 116361522 ns/iter (± 598967) 0.98
es/full/all/es2016 113601833 ns/iter (± 960108) 115232005 ns/iter (± 318420) 0.99
es/full/all/es2017 113493187 ns/iter (± 772427) 115238690 ns/iter (± 501063) 0.98
es/full/all/es2018 112200831 ns/iter (± 632173) 112811067 ns/iter (± 318681) 0.99
es/full/all/es2019 110693473 ns/iter (± 1025928) 112645382 ns/iter (± 873453) 0.98
es/full/all/es2020 107493804 ns/iter (± 996239) 108328565 ns/iter (± 551637) 0.99
es/full/parser 454685 ns/iter (± 2202) 479071 ns/iter (± 1992) 0.95
es/full/base/fixer 15417 ns/iter (± 91) 15417 ns/iter (± 81) 1
es/full/base/resolver_and_hygiene 79517 ns/iter (± 375) 81948 ns/iter (± 132) 0.97
serialization of serde 261 ns/iter (± 6) 278 ns/iter (± 5) 0.94
css/minify/libraries/bootstrap 22312637 ns/iter (± 117882) 22114003 ns/iter (± 151386) 1.01
css/visitor/compare/clone 1389499 ns/iter (± 8994) 1361661 ns/iter (± 12214) 1.02
css/visitor/compare/visit_mut_span 1499300 ns/iter (± 9027) 1499113 ns/iter (± 10751) 1.00
css/visitor/compare/visit_mut_span_panic 1532715 ns/iter (± 8670) 1503948 ns/iter (± 40324) 1.02
css/visitor/compare/fold_span 2008153 ns/iter (± 7105) 2001507 ns/iter (± 6708) 1.00
css/visitor/compare/fold_span_panic 2140669 ns/iter (± 5361) 2133063 ns/iter (± 6301) 1.00
css/lexer/bootstrap_5_1_3 3431607 ns/iter (± 1429) 3448802 ns/iter (± 1990) 1.00
css/lexer/foundation_6_7_4 2791900 ns/iter (± 721) 2804521 ns/iter (± 2234) 1.00
css/lexer/tailwind_3_1_1 535164 ns/iter (± 766) 537987 ns/iter (± 174) 0.99
css/parser/bootstrap_5_1_3 15918319 ns/iter (± 37958) 15878334 ns/iter (± 47534) 1.00
css/parser/foundation_6_7_4 12738002 ns/iter (± 22426) 12698472 ns/iter (± 13196) 1.00
css/parser/tailwind_3_1_1 2506520 ns/iter (± 3263) 2548698 ns/iter (± 6391) 0.98
es/codegen/colors 724730 ns/iter (± 397891) 729786 ns/iter (± 397622) 0.99
es/codegen/large 3020033 ns/iter (± 1598955) 3000256 ns/iter (± 1635624) 1.01
es/codegen/with-parser/colors 41802 ns/iter (± 895) 41734 ns/iter (± 614) 1.00
es/codegen/with-parser/large 449834 ns/iter (± 1925) 447725 ns/iter (± 15145) 1.00
es/minify/libraries/antd 1644084542 ns/iter (± 32224670) 1438806357 ns/iter (± 29788774) 1.14
es/minify/libraries/d3 342266943 ns/iter (± 10215054) 282450747 ns/iter (± 4543087) 1.21
es/minify/libraries/echarts 1376292290 ns/iter (± 19522855) 1179495347 ns/iter (± 11578409) 1.17
es/minify/libraries/jquery 90081666 ns/iter (± 2247335) 82595936 ns/iter (± 215782) 1.09
es/minify/libraries/lodash 112638942 ns/iter (± 1322956) 103967401 ns/iter (± 378358) 1.08
es/minify/libraries/moment 50916042 ns/iter (± 842885) 48131986 ns/iter (± 129689) 1.06
es/minify/libraries/react 16817598 ns/iter (± 156654) 16166568 ns/iter (± 42947) 1.04
es/minify/libraries/terser 258104244 ns/iter (± 6220613) 217719259 ns/iter (± 1348242) 1.19
es/minify/libraries/three 445896692 ns/iter (± 9278615) 368847203 ns/iter (± 4566028) 1.21
es/minify/libraries/typescript 2980067534 ns/iter (± 23644645) 2723896469 ns/iter (± 23306413) 1.09
es/minify/libraries/victory 760472303 ns/iter (± 27339371) 586586185 ns/iter (± 8869606) 1.30
es/minify/libraries/vue 136477618 ns/iter (± 3866225) 121494972 ns/iter (± 429754) 1.12
es/visitor/compare/clone 1742909 ns/iter (± 7975) 1739698 ns/iter (± 22147) 1.00
es/visitor/compare/visit_mut_span 2074909 ns/iter (± 8065) 2074160 ns/iter (± 10430) 1.00
es/visitor/compare/visit_mut_span_panic 2086623 ns/iter (± 35182) 2090012 ns/iter (± 45521) 1.00
es/visitor/compare/fold_span 2782568 ns/iter (± 28845) 2819679 ns/iter (± 8755) 0.99
es/visitor/compare/fold_span_panic 2819741 ns/iter (± 22159) 2831445 ns/iter (± 4621) 1.00
es/lexer/colors 9292 ns/iter (± 64) 9010 ns/iter (± 75) 1.03
es/lexer/angular 4807038 ns/iter (± 25111) 4685921 ns/iter (± 4636) 1.03
es/lexer/backbone 624476 ns/iter (± 2031) 614408 ns/iter (± 1004) 1.02
es/lexer/jquery 3527799 ns/iter (± 10884) 3468887 ns/iter (± 14087) 1.02
es/lexer/jquery mobile 5200410 ns/iter (± 4230) 5154489 ns/iter (± 15582) 1.01
es/lexer/mootools 2755688 ns/iter (± 9633) 2708157 ns/iter (± 4945) 1.02
es/lexer/underscore 514861 ns/iter (± 465) 509417 ns/iter (± 2452) 1.01
es/lexer/three 15795442 ns/iter (± 24329) 15538302 ns/iter (± 13363) 1.02
es/lexer/yui 2859807 ns/iter (± 3628) 2790885 ns/iter (± 2987) 1.02
es/lexer/cal-com 12917773 ns/iter (± 41724) 12336588 ns/iter (± 64664) 1.05
es/lexer/typescript 88760060 ns/iter (± 205953) 85845090 ns/iter (± 492112) 1.03
es/parser/colors 24818 ns/iter (± 101) 23775 ns/iter (± 104) 1.04
es/parser/angular 12673830 ns/iter (± 76796) 12331639 ns/iter (± 80277) 1.03
es/parser/backbone 1851200 ns/iter (± 7289) 1813175 ns/iter (± 6760) 1.02
es/parser/jquery 10213214 ns/iter (± 77889) 10038283 ns/iter (± 86291) 1.02
es/parser/jquery mobile 15402415 ns/iter (± 129838) 15037798 ns/iter (± 209753) 1.02
es/parser/mootools 7946749 ns/iter (± 232681) 7771047 ns/iter (± 24407) 1.02
es/parser/underscore 1612129 ns/iter (± 8881) 1583659 ns/iter (± 5093) 1.02
es/parser/three 44306728 ns/iter (± 665941) 43478687 ns/iter (± 722440) 1.02
es/parser/yui 7542092 ns/iter (± 49108) 7329280 ns/iter (± 44086) 1.03
es/parser/cal-com 40198427 ns/iter (± 428526) 39949964 ns/iter (± 680319) 1.01
es/parser/typescript 273059705 ns/iter (± 2707962) 269676364 ns/iter (± 2915624) 1.01
es/preset-env/usage/builtin_type 136197 ns/iter (± 34306) 139596 ns/iter (± 33815) 0.98
es/preset-env/usage/property 16705 ns/iter (± 90) 17132 ns/iter (± 332) 0.98
es/resolver/typescript 104305055 ns/iter (± 2404450) 101063398 ns/iter (± 3244718) 1.03
es/fixer/typescript 85292565 ns/iter (± 3811390) 79622031 ns/iter (± 1966170) 1.07
es/hygiene/typescript 187820298 ns/iter (± 8234376) 179404666 ns/iter (± 3841521) 1.05
es/resolver_with_hygiene/typescript 308903390 ns/iter (± 7101788) 313227279 ns/iter (± 4597237) 0.99
es/visitor/base-perf/module_clone 57475 ns/iter (± 1204) 57665 ns/iter (± 742) 1.00
es/visitor/base-perf/fold_empty 60899 ns/iter (± 785) 60947 ns/iter (± 593) 1.00
es/visitor/base-perf/fold_noop_impl_all 60166 ns/iter (± 315) 60194 ns/iter (± 671) 1.00
es/visitor/base-perf/fold_noop_impl_vec 60445 ns/iter (± 805) 60764 ns/iter (± 864) 0.99
es/visitor/base-perf/boxing_boxed_clone 60 ns/iter (± 0) 59 ns/iter (± 0) 1.02
es/visitor/base-perf/boxing_unboxed_clone 47 ns/iter (± 0) 48 ns/iter (± 0) 0.98
es/visitor/base-perf/boxing_boxed 106 ns/iter (± 0) 105 ns/iter (± 0) 1.01
es/visitor/base-perf/boxing_unboxed 81 ns/iter (± 0) 81 ns/iter (± 0) 1
es/visitor/base-perf/visit_contains_this 2631 ns/iter (± 15) 2598 ns/iter (± 28) 1.01
es/base/parallel/resolver/typescript 2481384713 ns/iter (± 140007512) 2413018688 ns/iter (± 185462682) 1.03
es/base/parallel/hygiene/typescript 3221111501 ns/iter (± 96834711) 3193268293 ns/iter (± 44364301) 1.01
babelify-only 494334 ns/iter (± 8063) 491926 ns/iter (± 1666) 1.00
parse_and_babelify_angular 38491720 ns/iter (± 484369) 42411705 ns/iter (± 1158639) 0.91
parse_and_babelify_backbone 4345562 ns/iter (± 137491) 4345462 ns/iter (± 174953) 1.00
parse_and_babelify_jquery 29185202 ns/iter (± 265528) 28176205 ns/iter (± 360219) 1.04
parse_and_babelify_jquery_mobile 49099440 ns/iter (± 908058) 50436959 ns/iter (± 698863) 0.97
parse_and_babelify_mootools 26223602 ns/iter (± 178468) 26045338 ns/iter (± 535790) 1.01
parse_and_babelify_underscore 3672218 ns/iter (± 23012) 3652530 ns/iter (± 19803) 1.01
parse_and_babelify_yui 25060863 ns/iter (± 1568993) 23953095 ns/iter (± 455282) 1.05
html/minify/document/css_spec 45898776 ns/iter (± 261477) 45615029 ns/iter (± 308103) 1.01
html/minify/document/github 18197568 ns/iter (± 54852) 18288359 ns/iter (± 75946) 1.00
html/minify/document/stackoverflow 16575801 ns/iter (± 437346) 16753357 ns/iter (± 611153) 0.99
html/minify/document_fragment/css_spec 44865794 ns/iter (± 248879) 44120178 ns/iter (± 348928) 1.02
html/minify/document_fragment/github 17934543 ns/iter (± 24880) 17902187 ns/iter (± 116267) 1.00
html/minify/document_fragment/stackoverflow 16290168 ns/iter (± 82993) 16359674 ns/iter (± 152807) 1.00
html/document/visitor/compare/clone 165896 ns/iter (± 1077) 164802 ns/iter (± 3582) 1.01
html/document/visitor/compare/visit_mut_span 182235 ns/iter (± 1259) 183216 ns/iter (± 1246) 0.99
html/document/visitor/compare/visit_mut_span_panic 186562 ns/iter (± 724) 195037 ns/iter (± 6063) 0.96
html/document/visitor/compare/fold_span 227729 ns/iter (± 1433) 230504 ns/iter (± 1008) 0.99
html/document/visitor/compare/fold_span_panic 278832 ns/iter (± 1715) 282061 ns/iter (± 1562) 0.99
html/document_fragment/visitor/compare/clone 166219 ns/iter (± 819) 164812 ns/iter (± 1180) 1.01
html/document_fragment/visitor/compare/visit_mut_span 181303 ns/iter (± 920) 181550 ns/iter (± 1195) 1.00
html/document_fragment/visitor/compare/visit_mut_span_panic 186310 ns/iter (± 758) 185858 ns/iter (± 965) 1.00
html/document_fragment/visitor/compare/fold_span 231063 ns/iter (± 1178) 230381 ns/iter (± 1304) 1.00
html/document_fragment/visitor/compare/fold_span_panic 279025 ns/iter (± 734) 279585 ns/iter (± 1014) 1.00
html/lexer/css_2021_spec 13014879 ns/iter (± 90336) 13096935 ns/iter (± 57380) 0.99
html/lexer/github_com_17_05_2022 4995179 ns/iter (± 6588) 4996616 ns/iter (± 5818) 1.00
html/lexer/stackoverflow_com_17_05_2022 4744564 ns/iter (± 19612) 4748562 ns/iter (± 30298) 1.00
html/parser/parser_document/css_2021_spec 26043138 ns/iter (± 120447) 26458960 ns/iter (± 806732) 0.98
html/parser/parser_document/github_com_17_05_2022 8588393 ns/iter (± 12878) 8709954 ns/iter (± 65488) 0.99
html/parser/parser_document/stackoverflow_com_17_05_2022 7554263 ns/iter (± 13226) 7605079 ns/iter (± 38229) 0.99
html/parser/parser_document_fragment/css_2021_spec 25723596 ns/iter (± 101320) 26354052 ns/iter (± 109482) 0.98
html/parser/parser_document_fragment/github_com_17_05_2022 8563349 ns/iter (± 23380) 8704204 ns/iter (± 12646) 0.98
html/parser/parser_document_fragment/stackoverflow_com_17_05_2022 7502298 ns/iter (± 42602) 7667751 ns/iter (± 6363) 0.98

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.