Tree benchmark

These guys are reusable between different examples and benchmarks. Not in this PR, but we can share them in a separate file.