Closed ArtemGr closed 3 years ago
Did some benchmarks, https://gitlab.com/artemciy/lin-socks/-/blob/95d2bb96/bench/stack-string.rs
old i7
write_string time: [142.63 ns 143.45 ns 144.32 ns]
write_cursor time: [41.238 ns 41.339 ns 41.456 ns]
write_cursor_uninit time: [37.525 ns 37.588 ns 37.661 ns]
write_smallvec time: [62.710 ns 62.767 ns 62.843 ns]
write_inlinable_string time: [54.599 ns 54.631 ns 54.668 ns]
VPS, QEMU Virtual CPU version 2.5+
write_string time: [108.38 ns 109.77 ns 111.61 ns]
write_cursor time: [47.222 ns 47.999 ns 48.945 ns]
write_cursor_uninit time: [44.930 ns 45.296 ns 45.691 ns]
write_smallvec time: [56.464 ns 56.991 ns 57.739 ns]
write_inlinable_string time: [68.181 ns 68.313 ns 68.510 ns]
Works in the Linux kernel:
To give it a go, use