smite-scenarios: disable wallet fsync in regtest bitcoind - #191
smite-scenarios: disable wallet fsync in regtest bitcoind#191erickcestari wants to merge 1 commit into
Conversation
The coinbase of every generated block pays a wallet address, so connecting it commits the sqlite wallet with synchronous=FULL, one fsync per block. -unsafesqlitesync=1 sets synchronous=OFF, which is what Bitcoin Core's own functional test framework does. Only matters when the datadir sits on a real filesystem, as in a local docker run: there `-generate 6` drops from ~103ms to ~4ms and startup's `-generate 101` from ~1469ms to ~40ms. Under Nyx the guest rootfs is the initramfs, where fsync is a no-op, so this changes nothing.
|
Should we document this in the README instead of changing the Something like: Measuring PerformanceLocal mode writes to the image's filesystem, while the Nyx guest unpacks the docker run --rm --tmpfs /tmp:rw,exec,size=1g \
-v $PWD/input.bin:/input.bin -e SMITE_INPUT=/input.bin -e RUST_LOG=debug \
smite-$TARGET-$SCENARIO /$TARGET-scenario
|
There was a problem hiding this comment.
utACK 9572e82
LGTM, I think we also care more about speed than robustness, similar to the arguments in bitcoin/bitcoin#21634:
This syncing behavior is necessary for normal operation as it helps guarantee that data won't become lost or corrupted, but in tests, we don't care about that.
Sadly (or perhaps happily), this doesn't make a noticeable difference in practice when running the fuzzer. The improvement is only observable when running inside a Docker container. Even there, using |
The coinbase of every generated block pays a wallet address, so connecting it commits the sqlite wallet with synchronous=FULL, one fsync per block.
-unsafesqlitesync=1sets synchronous=OFF, which is what Bitcoin Core's own functional test framework does.Only matters when the datadir sits on a real filesystem, as in a local docker run: there
-generate 6drops from ~103ms to ~4ms and startup's-generate 101from ~1469ms to ~40ms. Under Nyx the guest rootfs is the initramfs, where fsync is a no-op, so this changes nothing.This flag should make docker's execution speed closer to performance when running inside the NYX VM.