Skip to content

Commit 671f603

Browse files
authored
Update README.md
1 parent 80a5ceb commit 671f603

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ tree.estimate_count(query);
129129
#### Queries
130130
131131
* For-each over all elements: `tree.for_each(callback);`
132+
**Note that `for_each` tends to be 10%-20% faster than using an iterator.**
132133
* Iterator over all elements: `auto iterator = tree.begin();`
133134
* For-each with box shaped window queries: `tree.for_each(PhBoxD(min, max), callback);`
134135
* Iterator for box shaped window queries: `auto q = tree.begin_query(PhBoxD(min, max));`
@@ -432,7 +433,7 @@ heavily on the actual dataset, usage patterns, hardware, ... .
432433

433434
There are numerous ways to improve performance. The following list gives an overview over the possibilities.
434435

435-
1) **Use `for_each` instead of iterators**. This should improve performance of queries by 5%-10%.
436+
1) **Use `for_each` instead of iterators**. This should improve performance of queries by 10%-20%.
436437

437438
2) **Use `emplace_hint` if possible**. When updating the position of an entry, the naive way is to use `erase()`
438439
/`emplace()`. With `emplace_hint`, insertion can avoid navigation to the target node if the insertion coordinate is

0 commit comments

Comments
 (0)