# sum_tree: Implement recursive \`Sumtree::find\`, use it over \`Cursor::seek\` if possible \(\#40700\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/d8f4293ac3f5807703016cdba575ed2612b335e0)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: d8f4293ac3f5807703016cdba575ed2612b335e0

Requested commit: d8f4293ac3f5807703016cdba575ed2612b335e0

Commit: d8f4293ac3f5807703016cdba575ed2612b335e0

Tree: 348c79bdf63611fe13eba5b336ee1488b7e0f564

Author: Lukas Wirth

Committer: GitHub

## Message

````
sum_tree: Implement recursive `Sumtree::find`, use it over `Cursor::seek` if possible (#40700)

Reduces peak stack usage in these functions and should generally be a
bit performant.

Display map benchmark results
```
To tab point/to_tab_point/1024
                        time:   [531.40 ns 532.10 ns 532.97 ns]
                        change: [-2.1824% -2.0054% -1.8125%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe

To fold point/to_fold_point/1024
                        time:   [530.81 ns 531.30 ns 531.80 ns]
                        change: [-2.0295% -1.9054% -1.7716%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
```

Release Notes:

- N/A *or* Added/Fixed/Improved ...
````

## Parents

- [b6fb1d0a19ab6f3959a51603b9948c05da5f6097](https://git.cafe/gitcafe/zed/commit/b6fb1d0a19ab6f3959a51603b9948c05da5f6097?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/d8f4293ac3f5807703016cdba575ed2612b335e0?format=markdown)
