Skip to content

perf(ldk): replace signal poll loop with synchronous sigwait - #197

Open
erickcestari wants to merge 1 commit into
lnfuzz:masterfrom
erickcestari:ldk-sigwait
Open

perf(ldk): replace signal poll loop with synchronous sigwait#197
erickcestari wants to merge 1 commit into
lnfuzz:masterfrom
erickcestari:ldk-sigwait

Conversation

@erickcestari

Copy link
Copy Markdown
Contributor

Replaced asynchronous signal handlers (libc::signal + AtomicBool) and a 50ms polling sleep with pthread_sigmask and blocking libc::sigwait.

before:

  aggregate over 5 runs:
    execs/sec: mean 8.8  stddev 0.1  min 8.7  max 8.9
    boot + snapshot: mean 4.041 s
    latency (mean across runs):
      min 107.27 ms  mean 113.35 ms  median 113.30 ms  p99 118.16 ms  max 137.89 ms
    input execution (mean across runs): mean 109.22 ms  median 109.09 ms
    nyx overhead (mean across runs):     mean 4.13 ms  median 4.22 ms
    failed iterations: 0 / 500
    coverage determinism: 83.5% stable (15222 / 92312 edges fluctuated, summed over runs)

INFO  [smite::runners] Reading input from "/input.bin"
DEBUG [smite_scenarios::scenarios::ir] [5.071µs] Executing IR program (40 instructions, 406 input bytes)
DEBUG [smite_scenarios::executor] [119.157µs] SendOpenChannel: 327 bytes
DEBUG [smite_scenarios::executor] [126.085µs] RecvAcceptChannel: waiting
DEBUG [smite_scenarios::executor] [1.911781ms] RecvAcceptChannel: received
DEBUG [smite_scenarios::executor] [7.146892ms] SendFundingCreated: 132 bytes
DEBUG [smite_scenarios::executor] [7.182271ms] RecvFundingSigned: waiting
DEBUG [smite_scenarios::executor] [9.630999ms] RecvFundingSigned: received
DEBUG [smite_scenarios::executor] [9.977985ms] BroadcastTransaction: txid=de0cf6c15ea6cce7a6bc8ad5fe9e83c7545f50586a9f2586817838423ad82bbe
DEBUG [smite_scenarios::executor] [22.79079ms] MineBlocks: mined 6 block(s)
DEBUG [smite_scenarios::executor] [22.882372ms] SendChannelReady: 67 bytes
DEBUG [smite_scenarios::executor] [24.780335ms] RecvChannelReady: waiting
DEBUG [smite_scenarios::executor] [61.01623ms] RecvChannelReady: received
DEBUG [smite_scenarios::scenarios::ir] [61.031084ms] Program executed successfully
DEBUG [smite_scenarios::scenarios::ir] [101.260578ms] Target responded with pong

after:

  aggregate over 5 runs:
    execs/sec: mean 14.2  stddev 0.1  min 14.1  max 14.3
    boot + snapshot: mean 4.029 s
    latency (mean across runs):
      min 67.81 ms  mean 70.41 ms  median 70.14 ms  p99 81.12 ms  max 81.61 ms
    input execution (mean across runs): mean 68.34 ms  median 68.15 ms
    nyx overhead (mean across runs):     mean 2.07 ms  median 1.83 ms
    failed iterations: 0 / 500
    coverage determinism: 80.3% stable (18070 / 91809 edges fluctuated, summed over runs)

INFO  [smite::runners] Reading input from "/input.bin"
DEBUG [smite_scenarios::scenarios::ir] [4.611µs] Executing IR program (40 instructions, 406 input bytes)
DEBUG [smite_scenarios::executor] [113.28µs] SendOpenChannel: 327 bytes
DEBUG [smite_scenarios::executor] [119.826µs] RecvAcceptChannel: waiting
DEBUG [smite_scenarios::executor] [883.175µs] RecvAcceptChannel: received
DEBUG [smite_scenarios::executor] [6.123234ms] SendFundingCreated: 132 bytes
DEBUG [smite_scenarios::executor] [6.157739ms] RecvFundingSigned: waiting
DEBUG [smite_scenarios::executor] [8.2297ms] RecvFundingSigned: received
DEBUG [smite_scenarios::executor] [8.592972ms] BroadcastTransaction: txid=7c52544c5646978c4757c5342bd8bbdbf22c302a932dbd3b7d44602b15d80914
DEBUG [smite_scenarios::executor] [21.934378ms] MineBlocks: mined 6 block(s)
DEBUG [smite_scenarios::executor] [22.055101ms] SendChannelReady: 67 bytes
DEBUG [smite_scenarios::executor] [25.280867ms] RecvChannelReady: waiting
DEBUG [smite_scenarios::executor] [35.929502ms] RecvChannelReady: received
DEBUG [smite_scenarios::scenarios::ir] [35.948273ms] Program executed successfully
DEBUG [smite_scenarios::scenarios::ir] [76.452444ms] Target responded with pong

Replaced asynchronous signal handlers (`libc::signal` + `AtomicBool`) and
a 50ms polling sleep with `pthread_sigmask` and blocking `libc::sigwait`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant