-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
miniscript: implement from_tree nonrecursively
This also drops the FromTree impls for Terminal and Arc<Terminal>. As argued elsewhere, the Terminal types are not first-class types and it doesn't make sense to allow them to be constructed in elaborate ways. The benchmarks are pretty noisy but appear to show a pretty big speedup. On master: test expression::benches::parse_tree ... bench: 885.43 ns/iter (+/- 412.97) test expression::benches::parse_tree_deep ... bench: 1,951.10 ns/iter (+/- 845.66) test miniscript::benches::parse_segwit0 ... bench: 9,571.35 ns/iter (+/- 565.98) test miniscript::benches::parse_segwit0_deep ... bench: 25,571.58 ns/iter (+/- 468.93) On this commit: test expression::benches::parse_tree ... bench: 1,020.52 ns/iter (+/- 139.58) test expression::benches::parse_tree_deep ... bench: 1,632.75 ns/iter (+/- 176.35) test miniscript::benches::parse_segwit0 ... bench: 10,747.28 ns/iter (+/- 2,338.26) test miniscript::benches::parse_segwit0_deep ... bench: 19,090.65 ns/iter (+/- 1,040.62) So if you take the numbers at face value, that's a 33% speedup on the parse_segwit0_deep benchmark. Nice.
- Loading branch information
Showing
2 changed files
with
193 additions
and
181 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
Oops, something went wrong.