mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
perf(parser): inline end_span and parse_identifier_kind which are on the hot path (#2612)
This commit is contained in:
parent
49778abb80
commit
bf42158ad7
3 changed files with 5 additions and 4 deletions
|
|
@ -146,8 +146,8 @@ opt-level = 'z'
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
lto = "fat"
|
lto = "fat"
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
strip = "symbols"
|
strip = false
|
||||||
debug = false
|
debug = true
|
||||||
panic = "abort" # Let it crash and force ourselves to write safe Rust.
|
panic = "abort" # Let it crash and force ourselves to write safe Rust.
|
||||||
|
|
||||||
# Use the `--profile release-debug` flag to show symbols in release mode.
|
# Use the `--profile release-debug` flag to show symbols in release mode.
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ impl<'a> ParserImpl<'a> {
|
||||||
Span::new(token.start, 0)
|
Span::new(token.start, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn end_span(&self, span: Span) -> Span {
|
#[inline]
|
||||||
let mut span = span;
|
pub(crate) fn end_span(&self, mut span: Span) -> Span {
|
||||||
span.end = self.prev_token_end;
|
span.end = self.prev_token_end;
|
||||||
span
|
span
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,7 @@ impl<'a> ParserImpl<'a> {
|
||||||
IdentifierName { span, name }
|
IdentifierName { span, name }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub(crate) fn parse_identifier_kind(&mut self, kind: Kind) -> (Span, Atom<'a>) {
|
pub(crate) fn parse_identifier_kind(&mut self, kind: Kind) -> (Span, Atom<'a>) {
|
||||||
let span = self.start_span();
|
let span = self.start_span();
|
||||||
let name = self.cur_string();
|
let name = self.cur_string();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue