Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize BufferedReader::read for large buffers.
This optimizes `read` for the case in which the number of bytes requested is larger than the internal buffer. Note that the first comparison occurs again right afterwards and should thus be free. The second comparison occurs only in the cold branch.
- Loading branch information
3839696
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.
r=alexcrichton
3839696
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 mahkoh@3839696
3839696
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 mahkoh/rust/buffered_reader = 3839696 into auto
3839696
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.
mahkoh/rust/buffered_reader = 3839696 merged ok, testing candidate = 045bc28
3839696
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/1881
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1880
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/1873
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/1880
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1874
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/1873
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/1873
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1877
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/1871
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/1870
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/1873
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/1529
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/1528
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/1531
success: http://buildbot.rust-lang.org/builders/auto-win-64-opt/builds/368
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-t/builds/370
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-c/builds/361
3839696
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 = 045bc28