@@ -52,6 +52,7 @@ Node* OrthTree<Point, SplitRule, LeafAugType, InteriorAugType, kMD, kSkHeight,
5252
5353 // INFO: delete the whole tree directly if its size equals to the input size,
5454 // can be used to accelerate the whole deletion process
55+ #ifndef DISABLE_BATCH_DELETE_SIZE_OPT
5556 if (n == T->size ) {
5657 if (has_tomb) {
5758 BT::template DeleteTreeRecursive<Leaf, Interior>(T);
@@ -64,6 +65,7 @@ Node* OrthTree<Point, SplitRule, LeafAugType, InteriorAugType, kMD, kSkHeight,
6465 T->size = 0 ;
6566 return T;
6667 }
68+ #endif
6769
6870 if (T->is_leaf ) {
6971 return BT::template DeletePoints4Leaf<Leaf, Node*>(T, In);
@@ -159,8 +161,15 @@ Node* OrthTree<Point, SplitRule, LeafAugType, InteriorAugType, kMD, kSkHeight,
159161 assert (IT.tags [IT.rev_tag [i]].second == BT::kBucketNum + 3 );
160162
161163 if (IT.tags [IT.rev_tag [i]].first ->size == 0 ) { // NOTE: empty
164+
165+ #ifndef DISABLE_BATCH_DELETE_SIZE_OPT
162166 BT::template DeleteTreeRecursive<Leaf, Interior, false >(
163167 IT.tags [IT.rev_tag [i]].first );
168+ #else
169+ BT::template DeleteTreeRecursive<Leaf, Interior, true >(
170+ IT.tags [IT.rev_tag [i]].first );
171+ #endif
172+
164173 IT.tags [IT.rev_tag [i]].first = AllocEmptyLeafNode<Slice, Leaf>();
165174 } else { // NOTE: rebuild
166175 assert (BT::WithinBox (
0 commit comments