Only compute the tree if changes have been made