Commit db4bde0
committed
Merge bitcoin/bitcoin#33517: multiprocess: Fix high overhead from message logging
0626b90 multiprocess: align our logging with libmultiprocess's (Cory Fields)
9d06822 multiprocess: update multiprocess EventLoop construction to use options (Cory Fields)
Pull request description:
This fixes bitcoin-core/libmultiprocess#215 on Core's side. ~It depends on bitcoin-core/libmultiprocess#220 being merged upstream, and a PR to update our subtree. I've included a subtree merge from my repo here for now, but will rebase on top of the merge from upstream once it's in.~ Edit: Rebased on top of #33518.
For context: before bitcoin-core/libmultiprocess#220, libmultiprocess serializesd every log message parameter, even if that message was ultimately going to be discarded. The upstream PR accomplished 2 main things:
- Creates logging categories, similar to Core's
- Using macros, avoids serializing parameters for disabled log levels.
That allowed the expensive serialization to be skipped, but the default log level is `Trace`. This PR updates our usage of libmultiprocess options to honor our log categories and levels.
Because of the substantial unnecessary overhead (see the [flamegraphs](bitcoin-core/libmultiprocess#215). Logging accounts for 50% of my application's cpu time, and nearly 10% of bitcoin-node's, both of which go to ~0% once fixed), it'd be a shame to ship the first multiprocess binaries without this fixed. So I propose that we also backport this (and the required libmultiprocess subtree merge) ~to v30. Sorry about the timing~ :(
Edit: Didn't make it for v30, but it would still make sense to backport for a v30.1.
ACKs for top commit:
Sjors:
ACK 0626b90
TheCharlatan:
ACK 0626b90
sipa:
utACK 0626b90
Tree-SHA512: 70b63b62d1f6de547f4d4775538d7bcaf32f57d8a72c5b26762b57755810c8be6942d9dfebab43cf1c1d8d025a555f72a48e9ebf3d84f8d40d6592ca801cda5d1 file changed
+39
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
34 | 60 | | |
35 | | - | |
36 | | - | |
| 61 | + | |
| 62 | + | |
37 | 63 | | |
38 | 64 | | |
39 | 65 | | |
| |||
62 | 88 | | |
63 | 89 | | |
64 | 90 | | |
65 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
66 | 96 | | |
67 | 97 | | |
68 | 98 | | |
| |||
90 | 120 | | |
91 | 121 | | |
92 | 122 | | |
93 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
94 | 128 | | |
95 | 129 | | |
96 | 130 | | |
| |||
0 commit comments