Skip to main content

push_u64

Function push_u64 

Source
pub fn push_u64(out: &mut Vec<u8>, n: u64)
Expand description

Appends the decimal digits of n.

The digits go into a fixed twenty byte buffer that is then copied whole, with the length cut back afterwards to the digits that are actually there. A copy of a length the compiler can see is a couple of stores it writes inline; a copy of a length only known at run time is a call into the platform’s memmove, and getting into that call costs more than moving one digit. It showed up as eleven percent of SADD on the wire, where the whole reply is :0.