Skip to content

Instantly share code, notes, and snippets.

@l0rinc
l0rinc / benchmark.md
Last active March 24, 2025 11:27
Benchmarking meeting notes

Benchmarking meeting notes

Add a macro benchmark suite with longer-running operations, exercising a different set of functionality that is performance-critical.

  • One of them could be the speed of an assumeUTXO load-and-dump (this would check block read/write and (de)serialization, but only part of validation).
  • Another one could be an actual IBD for 840-880k blocks (small part of IBD, but should produce a representative comparison quickly).
  • Another one would be a reindex-chainstate up to e.g. 880k blocks (more realistic, but takes long and doesn't involve reading/writing blocks).
  • Lastly, several full IBDs to make sure the previous quick checks are representative (likely only required for big changes). We don't have to run all of these for every PR; it could be tied to labels added to PRs where the author/reviewers think they're relevant (e.g., not for doc typo fixes). This would require integration with CoreCheck.

Other suggested macro benchmarks by the participants:

  • Compact block reconstruction
@l0rinc
l0rinc / GetLegacySigOpCount.patch
Created May 17, 2025 15:12
[PATCH] Add paranoid sanity checks
diff --git a/src/script/script.cpp b/src/script/script.cpp
--- a/src/script/script.cpp (revision 6ddb22a8c89a40ec0d4d75a195c2bc0231933285)
+++ b/src/script/script.cpp (revision b34e14355d94b21064cc64977955bf696e09992e)
@@ -4,7 +4,8 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <script/script.h>
-
+#include <script/solver.h>
+#include <logging.h>
Pi 5, 4 GB, pruned node:
• Raspberry Pi 5 (4 GB RAM) - $66 - https://amazon.com/Raspberry-Pi-4GB-2023-Processor/dp/B0CK3L9WD3
• 128 GB NVMe SSD - $20 - https://www.amazon.com/Silicon-Power-128GB-P34A60-SP128GBP34A60M28/dp/B09HMWH1DG
• M.2 HAT for SSD - $8 - https://amazon.com/ZDE-ZP517A-Peripheral-Raspberry-Compatible/dp/B0D1QYDJJJ
• Aluminum heatsink - $4 - https://amazon.com/Raspberry-Aluminum-Heatsink-Cooling-Dissipation/dp/B0DY83ZZ31
• 5.1 V/5 A power supply - $13 - https://www.amazon.com/RasTech-Power-Supply-Raspberry-Adapter/dp/B0CLV6WB4L
Total: $111
----