Add additional inline hints in serialization methods 2021-05-ser-fast
authorMatt Corallo <git@bluematt.me>
Fri, 28 May 2021 14:07:39 +0000 (14:07 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 1 Jun 2021 15:47:01 +0000 (15:47 +0000)
commit7231b4a2456cee6bdb0eeee8c365c854ccf4c4d6
tree4bcc9608be744ba86ab157b46b2dc4540a995ca1
parent583e6ac6f0bf1fd311621ea7584d160bd6d7c192
Add additional inline hints in serialization methods

This substantially improves deserialization performance when LLVM
decides not to inline many short methods, eg when not building
with LTO/codegen-units=1.

Even with the default bench params of LTO/codegen-units=1, the
serialization benchmarks on an Intel 2687W v3 take:

test routing::network_graph::benches::read_network_graph  ... bench: 1,955,616,225 ns/iter (+/- 4,135,777)
test routing::network_graph::benches::write_network_graph ... bench: 165,905,275 ns/iter (+/- 118,798)
lightning/src/util/ser.rs