about summary refs log tree commit diff
path: root/web/tvixbolt
diff options
context:
space:
mode:
authorAspen Smith <root@gws.fyi>2024-07-28T16·11-0400
committerclbot <clbot@tvl.fyi>2024-08-07T12·38+0000
commitb8f92a6d535af09c24ac887855eb230ca25af1ed (patch)
tree82cea6a4d3979e0c48e9f97285b8564a24e9ceb0 /web/tvixbolt
parent1d7ba89c19b231898a997f1af3c13ed8c7247793 (diff)
feat(tvix/eval): Forbid Hash{Map,Set}, use Fx instead r/8453
Per https://nnethercote.github.io/perf-book/hashing.html, we have
basically no reason to use the default hasher over a faster,
non-DoS-resistant hasher. This gives a nice perf boost basically for
free:

hello outpath           time:   [704.76 ms 714.91 ms 725.63 ms]
                        change: [-7.2391% -6.1018% -4.9189%] (p = 0.00 < 0.05)
                        Performance has improved.

Change-Id: If5587f444ed3af69f8af4eead6af3ea303b4ae68
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12046
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Autosubmit: aspen <root@gws.fyi>
Diffstat (limited to 'web/tvixbolt')
-rw-r--r--web/tvixbolt/Cargo.lock9
-rw-r--r--web/tvixbolt/Cargo.nix22
2 files changed, 28 insertions, 3 deletions
diff --git a/web/tvixbolt/Cargo.lock b/web/tvixbolt/Cargo.lock
index ba19aba7866d..82162469dee9 100644
--- a/web/tvixbolt/Cargo.lock
+++ b/web/tvixbolt/Cargo.lock
@@ -1223,7 +1223,7 @@ dependencies = [
  "countme",
  "hashbrown 0.14.5",
  "memoffset",
- "rustc-hash",
+ "rustc-hash 1.1.0",
  "text-size",
 ]
 
@@ -1240,6 +1240,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
 
 [[package]]
+name = "rustc-hash"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
+
+[[package]]
 name = "rustversion"
 version = "1.0.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1561,6 +1567,7 @@ dependencies = [
  "regex",
  "rnix",
  "rowan",
+ "rustc-hash 2.0.0",
  "serde",
  "serde_json",
  "sha1",
diff --git a/web/tvixbolt/Cargo.nix b/web/tvixbolt/Cargo.nix
index 6247425c3de2..a2ad6cc33e80 100644
--- a/web/tvixbolt/Cargo.nix
+++ b/web/tvixbolt/Cargo.nix
@@ -3668,7 +3668,7 @@ rec {
           }
           {
             name = "rustc-hash";
-            packageId = "rustc-hash";
+            packageId = "rustc-hash 1.1.0";
           }
           {
             name = "text-size";
@@ -3695,7 +3695,7 @@ rec {
           "rustc-dep-of-std" = [ "core" "compiler_builtins" ];
         };
       };
-      "rustc-hash" = rec {
+      "rustc-hash 1.1.0" = rec {
         crateName = "rustc-hash";
         version = "1.1.0";
         edition = "2015";
@@ -3708,6 +3708,20 @@ rec {
         };
         resolvedDefaultFeatures = [ "default" "std" ];
       };
+      "rustc-hash 2.0.0" = rec {
+        crateName = "rustc-hash";
+        version = "2.0.0";
+        edition = "2021";
+        sha256 = "0lni0lf846bzrf3jvci6jaf4142n1mdqxvcpczk5ch9pfgyk8c2q";
+        authors = [
+          "The Rust Project Developers"
+        ];
+        features = {
+          "default" = [ "std" ];
+          "rand" = [ "dep:rand" "std" ];
+        };
+        resolvedDefaultFeatures = [ "default" "std" ];
+      };
       "rustversion" = rec {
         crateName = "rustversion";
         version = "1.0.17";
@@ -4643,6 +4657,10 @@ rec {
             packageId = "rowan";
           }
           {
+            name = "rustc-hash";
+            packageId = "rustc-hash 2.0.0";
+          }
+          {
             name = "serde";
             packageId = "serde";
             features = [ "rc" "derive" ];