about summary refs log tree commit diff
path: root/web/tvixbolt
diff options
context:
space:
mode:
authorAspen Smith <root@gws.fyi>2024-07-28T16·50-0400
committerclbot <clbot@tvl.fyi>2024-08-10T15·28+0000
commitd378111d774777f4a5f319946d26e3d481a49870 (patch)
tree50f3f40d24e00ab3f5d9e5a7ea0dc3b543ba34d3 /web/tvixbolt
parenta6d6fc418de0cdce921698410265fa78ca6b7f23 (diff)
feat(tvix/eval): Store hash in key of interner r/8474
Rather than storing the leaked allocation for the string as the key in
the interner, store the hash (using NoHashHashBuilder). I thought this
would improve performance, but it doesn't:

hello outpath           time:   [736.85 ms 748.42 ms 760.42 ms]
                        change: [-2.0754% +0.4798% +2.7096%] (p = 0.72 > 0.05)
                        No change in performance detected.

but it at least doesn't *hurt* performance, and it *does* avoid an
`unsafe`, so it's probably net good.

Change-Id: Ie413955bdb6f04b1f468f511e5ebce56e329fa37
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12049
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: aspen <root@gws.fyi>
Diffstat (limited to 'web/tvixbolt')
-rw-r--r--web/tvixbolt/Cargo.lock7
-rw-r--r--web/tvixbolt/Cargo.nix17
2 files changed, 24 insertions, 0 deletions
diff --git a/web/tvixbolt/Cargo.lock b/web/tvixbolt/Cargo.lock
index 82162469dee9..c12647b97e57 100644
--- a/web/tvixbolt/Cargo.lock
+++ b/web/tvixbolt/Cargo.lock
@@ -959,6 +959,12 @@ dependencies = [
 ]
 
 [[package]]
+name = "nohash-hasher"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
+
+[[package]]
 name = "nom8"
 version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1562,6 +1568,7 @@ dependencies = [
  "lazy_static",
  "lexical-core",
  "md-5",
+ "nohash-hasher",
  "os_str_bytes",
  "path-clean",
  "regex",
diff --git a/web/tvixbolt/Cargo.nix b/web/tvixbolt/Cargo.nix
index a2ad6cc33e80..68c34901a10b 100644
--- a/web/tvixbolt/Cargo.nix
+++ b/web/tvixbolt/Cargo.nix
@@ -2939,6 +2939,19 @@ rec {
           "simd-adler32" = [ "dep:simd-adler32" ];
         };
       };
+      "nohash-hasher" = rec {
+        crateName = "nohash-hasher";
+        version = "0.2.0";
+        edition = "2018";
+        sha256 = "0lf4p6k01w4wm7zn4grnihzj8s7zd5qczjmzng7wviwxawih5x9b";
+        authors = [
+          "Parity Technologies <admin@parity.io>"
+        ];
+        features = {
+          "default" = [ "std" ];
+        };
+        resolvedDefaultFeatures = [ "default" "std" ];
+      };
       "nom8" = rec {
         crateName = "nom8";
         version = "0.2.0";
@@ -4636,6 +4649,10 @@ rec {
             packageId = "md-5";
           }
           {
+            name = "nohash-hasher";
+            packageId = "nohash-hasher";
+          }
+          {
             name = "os_str_bytes";
             packageId = "os_str_bytes";
             features = [ "conversions" ];