From 90f9266d0097c91d5009163d5b2f5bbc658cf5cf Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Sun, 18 Feb 2024 03:49:31 +0000 Subject: [PATCH] chore(deps): update `bumpalo` crate (#2417) Latest version of `bumpalo` includes a couple of performance fixes for `String` (e.g. https://github.com/fitzgen/bumpalo/pull/229) which may help the parser a little. --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- crates/oxc_parser/src/lexer/identifier.rs | 2 -- crates/oxc_parser/src/lexer/string.rs | 2 -- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9eb7bdc659145..5101dc5176891 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" [[package]] name = "byteorder" diff --git a/Cargo.toml b/Cargo.toml index 6042808a0ba06..033e0b95be203 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,7 +86,7 @@ oxc_language_server = { path = "crates/oxc_language_server" } assert-unchecked = { version = "0.1.2" } bpaf = { version = "0.9.9" } bitflags = { version = "2.4.2" } -bumpalo = { version = "3.14.0" } +bumpalo = { version = "3.15.0" } convert_case = { version = "0.6.0" } criterion = { version = "0.5.1", default-features = false } crossbeam-channel = { version = "0.5.11" } diff --git a/crates/oxc_parser/src/lexer/identifier.rs b/crates/oxc_parser/src/lexer/identifier.rs index f98141e4403cb..30eadf41e0e57 100644 --- a/crates/oxc_parser/src/lexer/identifier.rs +++ b/crates/oxc_parser/src/lexer/identifier.rs @@ -155,8 +155,6 @@ impl<'a> Lexer<'a> { let mut str = String::with_capacity_in(capacity, self.allocator); // Push identifier up this point into `str` - // `bumpalo::collections::string::String::push_str` is currently expensive due to - // inefficiency in bumpalo's implementation. But best we have right now. str.push_str(so_far); // Process escape and get rest of identifier diff --git a/crates/oxc_parser/src/lexer/string.rs b/crates/oxc_parser/src/lexer/string.rs index c8c9297a8e94b..0092957928908 100644 --- a/crates/oxc_parser/src/lexer/string.rs +++ b/crates/oxc_parser/src/lexer/string.rs @@ -81,8 +81,6 @@ macro_rules! handle_string_literal_escape { let mut str = String::with_capacity_in(capacity, $lexer.allocator); // Push chunk before `\` into `str`. - // `bumpalo::collections::string::String::push_str` is currently expensive due to - // inefficiency in bumpalo's implementation. But best we have right now. str.push_str(so_far); 'outer: loop {