Skip to content

Commit 3ce9d81

Browse files
authored
perf(es/ast): Reduce redundant string comparison for Atoms (#10323)
**Description**: This PR addresses redundant string hashing operations in the `PhfHash` implementation, potentially optimizing runtime performance by eliminating duplicate hash computations.
1 parent 9852940 commit 3ce9d81

File tree

4 files changed

+278
-85
lines changed

4 files changed

+278
-85
lines changed

.changeset/silver-paws-dance.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
swc_ecma_ast: patch
3+
swc_core: patch
4+
---
5+
6+
chore(ast): try to reduce redundant hash for str

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/swc_ecma_ast/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ bitflags = { workspace = true }
4141
bytecheck = { workspace = true, optional = true }
4242
is-macro = { workspace = true }
4343
num-bigint = { workspace = true, features = ["serde"] }
44+
once_cell = { workspace = true }
4445
phf = { workspace = true, features = ["macros"] }
4546
rancor = { workspace = true, optional = true }
4647
rkyv = { workspace = true, optional = true }
48+
rustc-hash = { workspace = true }
4749
scoped-tls = { workspace = true }
4850
serde = { workspace = true, features = ["derive"], optional = true }
4951
shrink-to-fit = { workspace = true, optional = true }

0 commit comments

Comments
 (0)