From 75d1b72b7c8619692999df339471aee7aab5a085 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 2 Feb 2023 13:14:42 +0300 Subject: 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 Tested-by: BuildkiteCI Autosubmit: tazjin --- tvix/eval/src/vm.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/eval/src') diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs index 93bf853f9c26..46c9f79b2e57 100644 --- a/tvix/eval/src/vm.rs +++ b/tvix/eval/src/vm.rs @@ -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>, + pub import_cache: Box>, /// Parsed Nix search path, which is used to resolve `<...>` /// references. -- cgit 1.4.1