Replace hashing algorithm and disable debug logging for improved performance

This commit is contained in:
Dennis Kobert
2023-03-09 18:26:38 +01:00
committed by Keavon Chambers
parent 7ce9d6db05
commit 1c50f0030c
10 changed files with 35 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use std::marker::PhantomData;
use xxhash_rust::xxh3::Xxh3;
use graphene_core::Node;
@@ -14,7 +14,7 @@ pub struct CacheNode<T> {
impl<'i, T: 'i + Hash> Node<'i, T> for CacheNode<T> {
type Output = &'i T;
fn eval<'s: 'i>(&'s self, input: T) -> Self::Output {
let mut hasher = DefaultHasher::new();
let mut hasher = Xxh3::new();
input.hash(&mut hasher);
let hash = hasher.finish();
@@ -51,7 +51,7 @@ impl<'i, T: 'i + Hash> Node<'i, Option<T>> for LetNode<T> {
fn eval<'s: 'i>(&'s self, input: Option<T>) -> Self::Output {
match input {
Some(input) => {
let mut hasher = DefaultHasher::new();
let mut hasher = Xxh3::new();
input.hash(&mut hasher);
let hash = hasher.finish();