]> git.lizzy.rs Git - rust.git/commit
Specialize single-element writes to buffer
authorMark Rousskov <mark.simulacrum@gmail.com>
Sat, 15 May 2021 22:54:57 +0000 (18:54 -0400)
committerMark Rousskov <mark.simulacrum@gmail.com>
Sat, 29 May 2021 16:45:07 +0000 (12:45 -0400)
commit299ac7589410a4e9541d0483161abb9e455e0ec1
tree5725b24abd6a332ea3f575fd861c12b023b1f4c0
parent9f75dbfa69ba8508fa7765305f75cd96dff06078
Specialize single-element writes to buffer

copy_from_slice generally falls back to memcpy/memmove, which is much more expensive
than we need to write a single element in.

This saves 0.26% instructions on the diesel benchmark.
library/proc_macro/src/bridge/buffer.rs
library/proc_macro/src/bridge/rpc.rs