-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Description** - Switch the TreeStats from using custom Debug to Display - Instead of visiting the tree and passing back up the output recursively, mutate a single value - Make the `collect` function safe, since its requirements are satisfied by being passed the map reference. **Motivation** - Display is more in line with a custom string representation - Mild performance benefit to mutating a single value - Easier to call the safe function **Testing Done** `cargo test`. Ran hyperfine vs prev commit: ``` thedeck@c889f3b04fb0 blart % hyperfine --warmup 3 '/tmp/tree_stats_1 benches/dict.txt' '/tmp/tree_stats_2 benches/dict.txt' Benchmark 1: /tmp/tree_stats_1 benches/dict.txt Time (mean ± σ): 115.8 ms ± 5.1 ms [User: 103.6 ms, System: 4.6 ms] Range (min … max): 106.7 ms … 126.4 ms 22 runs Benchmark 2: /tmp/tree_stats_2 benches/dict.txt Time (mean ± σ): 107.3 ms ± 4.7 ms [User: 95.0 ms, System: 4.3 ms] Range (min … max): 99.5 ms … 122.7 ms 26 runs Summary /tmp/tree_stats_2 benches/dict.txt ran 1.08 ± 0.07 times faster than /tmp/tree_stats_1 benches/dict.txt ```
- Loading branch information
Showing
3 changed files
with
59 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters