mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 07:18:04 +08:00
Replace hashing algorithm and disable debug logging for improved performance
This commit is contained in:
committed by
Keavon Chambers
parent
7ce9d6db05
commit
1c50f0030c
@@ -45,6 +45,7 @@ kurbo = { git = "https://github.com/linebender/kurbo.git", features = [
|
||||
glam = { version = "0.22", features = ["serde"] }
|
||||
node-macro = { path="../node-macro" }
|
||||
boxcar = "0.1.0"
|
||||
xxhash-rust = {workspace = true}
|
||||
|
||||
[dependencies.serde]
|
||||
version = "1.0"
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user