core-lightning/gossipd
Rusty Russell 0370ed2eca gossipd: use pread in the store.
The next patch causes us to access the store while loading (we read
channel_updates for local peers), which messes up loading due to the
lseek involved.

Using pread() is atomic with seek & read, and also a bit more
efficient.  Make the header contiguous too, while we're here.

We don't need pwrite: we always open with O_APPEND which means the
seek-to-end is implicit.

MCP results from 5 runs, min-max(mean +/- stddev):
	store_load_msec:36771-38289(37529.6+/-5.3e+02)
	vsz_kb:1202316
	store_rewrite_sec:12.460000-13.280000(12.784+/-0.29)
	listnodes_sec:1.240000-1.410000(1.34+/-0.058)
	listchannels_sec:29.850000-31.840000(30.908+/-0.69)
	routing_sec:27.800000-31.790000(28.822+/-1.5)
	peer_write_all_sec:66.200000-68.720000(67.44+/-0.84)

MCP notable changes from previous patch (>1 stddev):
	-store_load_msec:39207-45089(41374.6+/-2.2e+03)
	+store_load_msec:36771-38289(37529.6+/-5.3e+02)
	-store_rewrite_sec:15.090000-16.790000(15.654+/-0.63)
	+store_rewrite_sec:12.460000-13.280000(12.784+/-0.29)
	-peer_write_all_sec:66.830000-76.850000(71.976+/-3.6)
	+peer_write_all_sec:66.200000-68.720000(67.44+/-0.84)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-11 18:31:34 -07:00
..
test gossipd: embed broadcast information into each structure. 2019-04-11 18:31:34 -07:00
broadcast.c broadcast: don't keep payload pointer. 2019-04-11 18:31:34 -07:00
broadcast.h broadcast: don't keep payload pointer. 2019-04-11 18:31:34 -07:00
gossip_constants.h Use node_id everywhere for nodes. 2019-04-09 12:37:16 -07:00
gossip_peerd_wire.csv Use node_id everywhere for nodes. 2019-04-09 12:37:16 -07:00
gossip_store.c gossipd: use pread in the store. 2019-04-11 18:31:34 -07:00
gossip_store.csv daemons: use amount_msat/amount_sat in all internal wire transfers. 2019-02-21 08:01:37 +00:00
gossip_store.h gossipd: gossip_store_get() to load a single store entry. 2019-04-11 18:31:34 -07:00
gossip_wire.csv Use node_id everywhere for nodes. 2019-04-09 12:37:16 -07:00
gossipd.c gossipd: remove some fields from struct chan. 2019-04-11 18:31:34 -07:00
Makefile Use node_id everywhere for nodes. 2019-04-09 12:37:16 -07:00
routing.c gossipd: remove some fields from struct chan. 2019-04-11 18:31:34 -07:00
routing.h gossipd: remove some fields from struct chan. 2019-04-11 18:31:34 -07:00