From c06fb01b3b7a752e0c04ba21a02cdc3f431055e1 Mon Sep 17 00:00:00 2001 From: Peter Kolloch Date: Wed, 21 Feb 2024 18:24:50 +0700 Subject: feat(tvix/nix-compat): input_derivations with StorePaths ...in `Derivation`. This is more type-safe and should consume less memory. This also removes some allocations in the potentially hot path of output hash calculation. https: //b.tvl.fyi/issues/264 Change-Id: I6ad7d3cb868dc9f750894d449a6065608ef06e8c Reviewed-on: https://cl.tvl.fyi/c/depot/+/10957 Tested-by: BuildkiteCI Reviewed-by: flokli Autosubmit: Peter Kolloch Reviewed-by: Peter Kolloch --- tvix/glue/src/tvix_store_io.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'tvix/glue/src/tvix_store_io.rs') diff --git a/tvix/glue/src/tvix_store_io.rs b/tvix/glue/src/tvix_store_io.rs index 375501b65a5a..296a369e29c1 100644 --- a/tvix/glue/src/tvix_store_io.rs +++ b/tvix/glue/src/tvix_store_io.rs @@ -140,17 +140,11 @@ impl TvixStoreIO { let input_nodes: BTreeSet = futures::stream::iter(drv.input_derivations.iter()) .map(|(input_drv_path, output_names)| { - // since Derivation is validated, we know this can be parsed. - let input_drv_path = - StorePathRef::from_absolute_path(input_drv_path.as_bytes()) - .expect("invalid drv path") - .to_owned(); - // look up the derivation object let input_drv = { let known_paths = self.known_paths.borrow(); known_paths - .get_drv_by_drvpath(&input_drv_path) + .get_drv_by_drvpath(input_drv_path) .unwrap_or_else(|| panic!("{} not found", input_drv_path)) .to_owned() }; -- cgit 1.4.1