about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorRuud van Asseldonk <dev@veniogames.com>2016-11-02 22:49:27 +0100
committerRuud van Asseldonk <dev@veniogames.com>2016-11-30 11:09:29 +0100
commitcd7fade0a9c1c8762d2fba7c65c1b82e8d369711 (patch)
tree946873bd4b027e019a115f2f1359ecd64ac6502e /src/test/incremental/thinlto
parent8e373b47872872a2ce61c5b02f4dd96d90d046ee (diff)
downloadrust-cd7fade0a9c1c8762d2fba7c65c1b82e8d369711.tar.gz
rust-cd7fade0a9c1c8762d2fba7c65c1b82e8d369711.zip
Add small-copy optimization for io::Cursor
During benchmarking, I found that one of my programs spent between 5 and
10 percent of the time doing memmoves. Ultimately I tracked these down
to single-byte slices being copied with a memcopy in io::Cursor::read().
Doing a manual copy if only one byte is requested can speed things up
significantly. For my program, this reduced the running time by 20%.

Why special-case only a single byte, and not a "small" slice in general?
I tried doing this for slices of at most 64 bytes and of at most 8
bytes. In both cases my test program was significantly slower.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions