Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up updating the hit-test tree #3052

Merged
merged 4 commits into from Sep 13, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Avoid allocating small vectors when updating the clip scroll tree.

  • Loading branch information
nical committed Sep 13, 2018
commit 371c8196a44aa7e40b8bbc476f111d5e664dd8f0
@@ -291,7 +291,9 @@ impl ClipScrollTree {
// TODO(gw): This is an ugly borrow check workaround to clone these.
// Restructure this to avoid the clones!
let mut state = state.clone();
let node_children = {
let mut node_children: SmallVec<[SpatialNodeIndex; 4]> = SmallVec::new();

{
let node = match self.spatial_nodes.get_mut(node_index.0) {
Some(node) => node,
None => return,
@@ -307,8 +309,8 @@ impl ClipScrollTree {
}

node.prepare_state_for_children(&mut state);
node.children.clone()
};
node_children.extend_from_slice(&node.children);
}

for child_node_index in node_children {
self.update_node(
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.