Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvement of shootout-binarytrees.rs
Part of #18085 Instead of using an Enum, we use a struct with Option<&Tree> as leaves. It allow to limit a lot of allocation. before: ``` texitoi@vaio:~/dev/benchmarksgame-rs$ time ./bin/binary-trees-orig 20 stretch tree of depth 21 check: -1 2097152 trees of depth 4 check: -2097152 524288 trees of depth 6 check: -524288 131072 trees of depth 8 check: -131072 32768 trees of depth 10 check: -32768 8192 trees of depth 12 check: -8192 2048 trees of depth 14 check: -2048 512 trees of depth 16 check: -512 128 trees of depth 18 check: -128 32 trees of depth 20 check: -32 long lived tree of depth 20 check: -1 real 0m3.860s user 0m11.032s sys 0m3.572s ``` after: ``` texitoi@vaio:~/dev/benchmarksgame-rs$ time ./bin/binary-trees 20 stretch tree of depth 21 check: -1 2097152 trees of depth 4 check: -2097152 524288 trees of depth 6 check: -524288 131072 trees of depth 8 check: -131072 32768 trees of depth 10 check: -32768 8192 trees of depth 12 check: -8192 2048 trees of depth 14 check: -2048 512 trees of depth 16 check: -512 128 trees of depth 18 check: -128 32 trees of depth 20 check: -32 long lived tree of depth 20 check: -1 real 0m2.824s user 0m9.224s sys 0m1.428s ```
- Loading branch information
629bcdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at TeXitoi@629bcdd
629bcdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging 1 batched pull requests into batch
629bcdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status: {"merge_sha": "431105a70acaf6e0a1d64b6dd3f69563d6694287", "rollup_pulls": [[20887, "629bcdd873dbe5d84977609a1114e0c3613b96c4"]]}
629bcdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing rollup candidate = 431105a
Successful merges:
629bcdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/3098
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/3091
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/3092
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/3083
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/3083
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/3086
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/3079
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/3074
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/2751
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/2749
success: http://buildbot.rust-lang.org/builders/auto-win-64-opt/builds/1587
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-t/builds/1579
629bcdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 431105a
629bcdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 431105a