Files
ladybird/Libraries/LibJS/Rust/Cargo.toml
Andreas Kling d9dd412440 LibJS: Use foldhash in parser and scope-collector hash maps
The std default RandomState (SipHash) was using ~9 percentage points
of CPU on hash_one and write across the parse hot path, with the
string interner adding another ~3 pp on top. The cost was spread
across the interner, the scope collector's IndexMap<Utf16String, _>,
and several parser-side HashSet<Utf16String> declarations.

Use foldhash::quality::RandomState for the parser, scope collector,
and string interner via a new fast_hash module. Quality keeps
HashDoS resistance (keys are lexer tokens, attacker-controlled in a
browser context) while shedding SipHash's per-byte cost, and on this
workload it benchmarks slightly faster than foldhash::fast.
2026-05-05 13:53:51 +02:00

25 lines
513 B
TOML

[package]
name = "libjs_rust"
version = "0.1.0"
edition = "2024"
[lib]
crate-type = ["staticlib"]
# After changing dependencies, regenerate the Flatpak sources:
# python3 Meta/CMake/flatpak/generate-cargo-sources.py
[dependencies]
libunicode_rust = { path = "../../LibUnicode/Rust", default-features = false }
num-bigint = "0.4"
num-traits = "0.2"
num-integer = "0.1"
indexmap = "2"
foldhash = "0.1"
[build-dependencies]
bytecode_def = { path = "../BytecodeDef" }
cbindgen = "0.29"
[lints]
workspace = true