refactor(tvix/eval): import_cache can be a HashMap
... instead of a BTreeMap, as we do not need ordering guarantees here. HashMaps are noticeably faster here (especially as we've been sorting essentially random data!). Change-Id: Ie92d74286df9f763c04c9b226ef1066ee8484c13 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8014 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su>
This commit is contained in:
parent
98ea614c6e
commit
75d1b72b7c
1 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
|||
//! Tvix bytecode.
|
||||
|
||||
use serde_json::json;
|
||||
use std::{cmp::Ordering, collections::BTreeMap, ops::DerefMut, path::PathBuf, rc::Rc};
|
||||
use std::{cmp::Ordering, collections::HashMap, ops::DerefMut, path::PathBuf, rc::Rc};
|
||||
|
||||
use crate::{
|
||||
chunk::Chunk,
|
||||
|
@ -113,7 +113,7 @@ pub struct VM<'o> {
|
|||
/// Import cache, mapping absolute file paths to the value that
|
||||
/// they compile to. Note that this reuses thunks, too!
|
||||
// TODO: should probably be based on a file hash
|
||||
pub import_cache: Box<BTreeMap<PathBuf, Value>>,
|
||||
pub import_cache: Box<HashMap<PathBuf, Value>>,
|
||||
|
||||
/// Parsed Nix search path, which is used to resolve `<...>`
|
||||
/// references.
|
||||
|
|
Loading…
Reference in a new issue