Skip to content

Instantly share code, notes, and snippets.

@PastaPastaPasta
Last active January 21, 2022 07:48
Show Gist options
  • Save PastaPastaPasta/e71cf0b8bafb3f4313c6ebbd45d2515f to your computer and use it in GitHub Desktop.
Save PastaPastaPasta/e71cf0b8bafb3f4313c6ebbd45d2515f to your computer and use it in GitHub Desktop.
pasta@pasta-ubuntu:~/workspace/bitcoin$ alias t='time ./src/bitcoin-cli --regtest'
pasta@pasta-ubuntu:~/workspace/bitcoin$ t getblockchaininfo
{
"chain": "regtest",
"blocks": 0,
"headers": 0,
"bestblockhash": "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206",
"difficulty": 4.656542373906925e-10,
"time": 1296688602,
"mediantime": 1296688602,
"verificationprogress": 1,
"initialblockdownload": true,
"chainwork": "0000000000000000000000000000000000000000000000000000000000000002",
"size_on_disk": 293,
"pruned": false,
"softforks": {
"bip34": {
"type": "buried",
"active": true,
"height": 1
},
"bip66": {
"type": "buried",
"active": true,
"height": 1
},
"bip65": {
"type": "buried",
"active": true,
"height": 1
},
"csv": {
"type": "buried",
"active": true,
"height": 1
},
"segwit": {
"type": "buried",
"active": true,
"height": 1
},
"testdummy": {
"type": "bip9",
"bip9": {
"status": "defined",
"start_time": 0,
"timeout": 9223372036854775807,
"since": 0,
"min_activation_height": 0
},
"active": false
},
"taproot": {
"type": "bip9",
"bip9": {
"status": "active",
"start_time": -1,
"timeout": 9223372036854775807,
"since": 0,
"min_activation_height": 0
},
"height": 0,
"active": true
}
},
"warnings": "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"
}
real 0m0.003s
user 0m0.002s
sys 0m0.000s
pasta@pasta-ubuntu:~/workspace/bitcoin$ t getnewaddress
error code: -18
error message:
No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created)
real 0m0.002s
user 0m0.002s
sys 0m0.000s
pasta@pasta-ubuntu:~/workspace/bitcoin$ t createwallet regtest
{
"name": "regtest",
"warning": ""
}
real 0m1.050s
user 0m0.000s
sys 0m0.002s
pasta@pasta-ubuntu:~/workspace/bitcoin$ t loadwallet regtest
error code: -4
error message:
Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?
real 0m0.002s
user 0m0.002s
sys 0m0.000s
pasta@pasta-ubuntu:~/workspace/bitcoin$ t getnewaddress
bcrt1qn7wc7rhlg8hyzrclhlf42smrlprs9rrnza0k8f
real 0m0.031s
user 0m0.002s
sys 0m0.000s
pasta@pasta-ubuntu:~/workspace/bitcoin$ t generatetoaddress 100 bcrt1qn7wc7rhlg8hyzrclhlf42smrlprs9rrnza0k8f
[
"68f99cfdc91209e4079143d6c95d093f1bc59409a650e8b186f977772df7d1ff",
...
"79111b51fa4d858bbb58c890cb433d31ca583e49d6874ec7a593a285018ac73c"
]
real 0m2.425s
user 0m0.000s
sys 0m0.002s
pasta@pasta-ubuntu:~/workspace/bitcoin$ t getblockchaininfo
{
"chain": "regtest",
"blocks": 100,
"headers": 100,
"bestblockhash": "79111b51fa4d858bbb58c890cb433d31ca583e49d6874ec7a593a285018ac73c",
"difficulty": 4.656542373906925e-10,
"time": 1642749508,
"mediantime": 1642749507,
"verificationprogress": 1,
"initialblockdownload": false,
"chainwork": "00000000000000000000000000000000000000000000000000000000000000ca",
"size_on_disk": 30177,
"pruned": false,
"softforks": {
"bip34": {
"type": "buried",
"active": true,
"height": 1
},
"bip66": {
"type": "buried",
"active": true,
"height": 1
},
"bip65": {
"type": "buried",
"active": true,
"height": 1
},
"csv": {
"type": "buried",
"active": true,
"height": 1
},
"segwit": {
"type": "buried",
"active": true,
"height": 1
},
"testdummy": {
"type": "bip9",
"bip9": {
"status": "defined",
"start_time": 0,
"timeout": 9223372036854775807,
"since": 0,
"min_activation_height": 0
},
"active": false
},
"taproot": {
"type": "bip9",
"bip9": {
"status": "active",
"start_time": -1,
"timeout": 9223372036854775807,
"since": 0,
"min_activation_height": 0
},
"height": 0,
"active": true
}
},
"warnings": "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"
}
real 0m0.002s
user 0m0.002s
sys 0m0.000s
pasta@pasta-ubuntu:~/workspace/bitcoin$ ./src/bench/bench_bitcoin
Warning, results might be unstable:
* CPU governor is '' but should be 'performance'
* Turbo is enabled, CPU frequency will fluctuate
Recommendations
* Use 'pyperf system tune' before benchmarking. See https://github.com/psf/pyperf
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 24,098,873.00 | 41.50 | 1.6% | 0.27 | `AddrManAdd`
| 53,114,816.00 | 18.83 | 0.5% | 0.59 | `AddrManAddThenGood`
| 195,991.60 | 5,102.26 | 0.4% | 0.01 | `AddrManGetAddr`
| 161.48 | 6,192,612.01 | 3.9% | 0.01 | `AddrManSelect`
| 264,087.00 | 3,786.63 | 0.3% | 0.01 | `AssembleBlock`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 55.46 | 18,030,667.21 | 0.3% | 0.01 | `Base58CheckEncode`
| 27.77 | 36,008,121.18 | 0.8% | 0.01 | `Base58Decode`
| 41.56 | 24,061,782.52 | 0.2% | 0.01 | `Base58Encode`
| 9.31 | 107,457,015.14 | 0.5% | 0.01 | `Bech32Decode`
| 18.99 | 52,647,238.48 | 0.6% | 0.01 | `Bech32Encode`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 116.87 | 8,556,813.83 | 1.1% | 0.01 | `BenchLockedPool`
| 3.75 | 266,594,195.83 | 0.1% | 0.01 | `BenchTimeDeprecated`
| 25.45 | 39,292,663.84 | 0.1% | 0.01 | `BenchTimeMillis`
| 23.85 | 41,925,829.96 | 0.0% | 0.01 | `BenchTimeMillisSys`
| 1.50 | 667,487,398.20 | 0.2% | 0.01 | `BenchTimeMock`
| 62,458,885.00 | 16.01 | 0.3% | 0.69 | `BlockToJsonVerbose`
| 39,069,138.00 | 25.60 | 0.4% | 0.43 | `BlockToJsonVerboseWrite`
| 1,068,208.00 | 936.15 | 1.0% | 0.01 | `BnBExhaustion`
| ns/job | job/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 1,097.46 | 911,197.01 | 2.7% | 0.40 | `CCheckQueueSpeedPrevectorJob`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 335.50 | 2,980,618.28 | 0.2% | 0.01 | `CCoinsCaching`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 1.59 | 630,588,133.41 | 0.4% | 0.02 | `CHACHA20_1MB`
| 1.63 | 615,193,415.74 | 0.3% | 0.01 | `CHACHA20_256BYTES`
| 1.72 | 582,827,125.31 | 0.2% | 0.01 | `CHACHA20_64BYTES`
| 4.41 | 226,766,792.93 | 0.1% | 0.05 | `CHACHA20_POLY1305_AEAD_1MB_ENCRYPT_DECRYPT`
| 2.20 | 454,817,177.61 | 0.1% | 0.03 | `CHACHA20_POLY1305_AEAD_1MB_ONLY_ENCRYPT`
| 6.53 | 153,029,403.65 | 0.4% | 0.01 | `CHACHA20_POLY1305_AEAD_256BYTES_ENCRYPT_DECRYPT`
| 3.28 | 305,003,753.94 | 0.2% | 0.01 | `CHACHA20_POLY1305_AEAD_256BYTES_ONLY_ENCRYPT`
| 12.49 | 80,036,991.27 | 0.5% | 0.01 | `CHACHA20_POLY1305_AEAD_64BYTES_ENCRYPT_DECRYPT`
| 6.22 | 160,700,662.21 | 0.1% | 0.01 | `CHACHA20_POLY1305_AEAD_64BYTES_ONLY_ENCRYPT`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 431,973.50 | 2,314.96 | 0.4% | 0.01 | `CoinSelection`
| 230,527,215.00 | 4.34 | 0.2% | 2.54 | `ComplexMemPool`
| ns/elem | elem/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 122.98 | 8,131,535.72 | 0.9% | 0.01 | `ConstructGCSFilter`
| ns/block | block/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 2,310,089.00 | 432.88 | 0.3% | 0.03 | `DeserializeAndCheckBlockTest`
| 1,587,693.00 | 629.84 | 0.2% | 0.02 | `DeserializeBlockTest`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 5,680,318.00 | 176.05 | 0.2% | 0.06 | `DuplicateInputs`
| 13,741.76 | 72,770.89 | 0.2% | 0.01 | `EvictionProtection0Networks250Candidates`
| 14,733.30 | 67,873.45 | 0.2% | 0.01 | `EvictionProtection1Networks250Candidates`
| 20,138.61 | 49,655.87 | 0.3% | 0.01 | `EvictionProtection2Networks250Candidates`
| 3,919.05 | 255,164.16 | 0.2% | 0.01 | `EvictionProtection3Networks050Candidates`
| 10,222.02 | 97,828.01 | 0.3% | 0.01 | `EvictionProtection3Networks100Candidates`
| 23,422.45 | 42,694.08 | 0.2% | 0.01 | `EvictionProtection3Networks250Candidates`
| 2.32 | 430,803,203.13 | 0.1% | 0.01 | `FastRandom_1bit`
| 7.70 | 129,849,810.93 | 0.1% | 0.01 | `FastRandom_32bit`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 0.50 | 1,994,516,191.31 | 0.0% | 0.01 | `HASH_1MB`
| 0.93 | 1,071,785,177.65 | 0.1% | 0.01 | `HASH_256BYTES`
| 2.22 | 451,024,939.77 | 0.1% | 0.01 | `HASH_64BYTES`
| ns/elem | elem/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 20,331.55 | 49,184.64 | 0.1% | 0.01 | `MatchGCSFilter`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 2.87 | 348,921,922.04 | 0.0% | 0.01 | `MempoolCheck`
| 23,056.28 | 43,372.13 | 2.4% | 0.01 | `MempoolEviction`
| ns/leaf | leaf/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 59.21 | 16,887,762.33 | 0.5% | 0.01 | `MerkleRoot`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 6,801.52 | 147,025.91 | 0.1% | 0.01 | `MuHash`
| 6,039.14 | 165,586.41 | 0.2% | 0.01 | `MuHashDiv`
| 6,045.44 | 165,413.89 | 0.1% | 0.01 | `MuHashMul`
| 729.22 | 1,371,333.56 | 0.1% | 0.01 | `MuHashPrecompute`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 0.60 | 1,674,332,750.51 | 0.4% | 0.01 | `POLY1305_1MB`
| 0.65 | 1,530,734,525.12 | 0.2% | 0.01 | `POLY1305_256BYTES`
| 0.82 | 1,225,888,725.51 | 0.0% | 0.01 | `POLY1305_64BYTES`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 49.88 | 20,046,523.24 | 0.4% | 0.01 | `PrePadded`
| 12.70 | 78,755,784.15 | 0.0% | 0.01 | `PrevectorClearNontrivial`
| 3.30 | 303,111,891.25 | 0.6% | 0.01 | `PrevectorClearTrivial`
| 162.24 | 6,163,594.12 | 0.1% | 0.01 | `PrevectorDeserializeNontrivial`
| 9.07 | 110,272,313.01 | 0.1% | 0.01 | `PrevectorDeserializeTrivial`
| 4.34 | 230,435,251.12 | 0.2% | 0.01 | `PrevectorDestructorNontrivial`
| 4.37 | 228,696,129.28 | 0.6% | 0.01 | `PrevectorDestructorTrivial`
| 6.35 | 157,490,746.23 | 0.0% | 0.01 | `PrevectorResizeNontrivial`
| 1.65 | 604,952,131.03 | 0.1% | 0.01 | `PrevectorResizeTrivial`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 1.97 | 508,722,815.76 | 0.1% | 0.02 | `RIPEMD160`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 89.90 | 11,122,955.43 | 0.4% | 0.01 | `RegularPadded`
| 389.46 | 2,567,672.17 | 1.5% | 0.01 | `RollingBloom`
| 22,670.19 | 44,110.80 | 0.2% | 0.01 | `RollingBloomReset`
| 9,359,679.00 | 106.84 | 0.2% | 0.10 | `RpcMempool`
| ns/byte | byte/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 1.34 | 744,949,984.06 | 0.3% | 0.01 | `SHA1`
| 0.50 | 1,994,696,103.06 | 0.0% | 0.01 | `SHA256`
| 0.90 | 1,116,090,549.52 | 2.2% | 0.01 | `SHA256D64_1024`
| 1.60 | 626,101,891.19 | 0.1% | 0.01 | `SHA256_32b`
| 3.02 | 331,090,197.25 | 0.0% | 0.03 | `SHA3_256_1M`
| 2.26 | 441,676,799.47 | 0.3% | 0.02 | `SHA512`
| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 22.05 | 45,358,976.26 | 0.2% | 0.01 | `SipHash_32b`
| 7.93 | 126,112,012.89 | 1.4% | 0.01 | `Trig`
| 63,859.94 | 15,659.27 | 0.3% | 0.01 | `VerifyNestedIfScript`
| 95,745.36 | 10,444.37 | 0.2% | 0.01 | `VerifyScriptBench`
| 17,325.04 | 57,719.94 | 0.1% | 0.01 | `WalletBalanceClean`
| 231,837.00 | 4,313.38 | 0.3% | 0.01 | `WalletBalanceDirty`
| 17,498.15 | 57,148.90 | 0.4% | 0.01 | `WalletBalanceMine`
| 21.50 | 46,519,280.88 | 0.1% | 0.01 | `WalletBalanceWatch`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment