-
-
Notifications
You must be signed in to change notification settings - Fork 339
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
perf(semantic): indextree #115
Comments
cc @YoniFeng, since you are really good at this kind of low level stuff, and I'm learning a lot from you. |
I need to get a setup for profiling native applications(on Windows..), been lazy so far. From reading indextree's doc and skimming the code, I'm skeptical that hand-rolling this tree on bumpallo will see significant gains. pub fn checked_append<T>(
self,
new_child: NodeId,
arena: &mut Arena<T>,
) -> Result<(), NodeError> {
if new_child == self {
return Err(NodeError::AppendSelf);
}
if arena[self].is_removed() || arena[new_child].is_removed() {
return Err(NodeError::Removed);
}
if self.ancestors(arena).any(|ancestor| new_child == ancestor) {
return Err(NodeError::AppendAncestor);
}
new_child.detach(arena);
insert_with_neighbors(arena, new_child, Some(self), arena[self].last_child, None)
.expect("Should never fail: `new_child` is not `self` and they are not removed");
Ok(())
} In our case, everything above In your profiling screenshot TL;DR I think making trying to make changes in |
Done in #122. |
We are currently constructing a parent pointing tree using the
indextree
crate, but this is probably an overkill both cpu and memory wise.The only functionality we need are:
For performance, I wonder if using
bumpalo
will be better than aVec
by using the same allocator for the AST.The text was updated successfully, but these errors were encountered: