Optimize editor performance for node selection, click target bounds, and batched messages (#3162)

* Don't clone messages during batch processing

* Improve selected nodes perf and memoize network hash computation

* Reuse click target bounding boxes for document bounds

* Early terminate computing the connected count

* Cleanup
This commit is contained in:
Dennis Kobert
2025-09-11 12:08:26 +02:00
committed by GitHub
parent ad5d8fcd37
commit 5836416632
12 changed files with 97 additions and 37 deletions

View File

@@ -9,7 +9,7 @@ pub use graphene_core::uuid::NodeId;
pub use graphene_core::uuid::generate_uuid;
use graphene_core::{Context, ContextDependencies, Cow, MemoHash, ProtoNodeIdentifier, Type};
use log::Metadata;
use rustc_hash::FxHashMap;
use rustc_hash::{FxBuildHasher, FxHashMap};
use std::collections::HashMap;
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
@@ -551,9 +551,8 @@ impl PartialEq for NodeNetwork {
/// Graph modification functions
impl NodeNetwork {
pub fn current_hash(&self) -> u64 {
let mut hasher = DefaultHasher::new();
self.hash(&mut hasher);
hasher.finish()
use std::hash::BuildHasher;
FxBuildHasher.hash_one(self)
}
pub fn value_network(node: DocumentNode) -> Self {