diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-04-09 19:49:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-09 19:49:11 +0200 |
commit | 0b4cb29386d34195d3030ce2cfb423866f39a775 (patch) | |
tree | fcb703e363dece1a39a9b86aea8d672df1a8fd16 /op_crates/fetch/lib.rs | |
parent | c86ee742a2522a169bfe40890b946c646aeac1cf (diff) |
perf(core): use BTreeMap for GothamState (#10073)
This commit replaces GothamState's internal HashMap
with a BTreeMap to improve performance.
OpState/GothamState keys by TypeId which is essentially
an opaque u64. For small sets of integer keys BTreeMap
outperforms HashMap mainly since it removes the hashing
overhead and Eq/Comp on integer-like types is very cheap,
it should also have a smaller memory footprint.
We only use ~30 unique types and thus ~30 unique keys to
access OpState, so the keyset is small and immutable
throughout the life of a JsRuntime, there's no meaningful
churn in keys added/removed.
Diffstat (limited to 'op_crates/fetch/lib.rs')
0 files changed, 0 insertions, 0 deletions