<p>Just doing</p>
<pre><code>while :
do
 time bitcoin-cli generatetoaddress 1 &lt;non_local_wallet_address&gt;
 bitcoin-cli getblockcount
done
</code></pre>
<p>brings regtest blockgen times up to 600ms when generating a block at the height 120k, even with all empty blocks.</p>
<p>I have noted down the following numbers:</p>
<pre><code>height, gen-time
800 -&gt; 7ms
5500 -&gt; 18ms
11000 -&gt; 31ms
22000 -&gt; 65ms
37000 -&gt; 110ms
</code></pre>
<p>and so on.</p>
<p>This makes my test suite slowing down a lot, over time.
Is this something we can deal with?</p>
<p>Thanks!</p>

CC BY-SA 4.0
2021-07-16T14:07:35.773Z
I can confirm this behavior. The difficulty is the same in regtest, so I don't think this should be happening. 
Unfortunately, I cannot provide any more help apart from suggesting to restructure your suite so that it does use 120k blocks.
sanket1729
CC BY-SA 4.0
2021-07-16T14:10:32.673Z
This is probably not related to block height. Because running `invalidate` and mining again from genesis does not help.
sanket1729
CC BY-SA 4.0
2021-07-16T18:40:04.103Z
Why do you need 120k blocks for a test?
Ava Chow
CC BY-SA 4.0
2021-07-16T18:48:59.257Z
If you add `-debug=bench` to your `bitcoind` command, then the debug.log file will contain log lines with benchmarks for some part of the block generation process. That may help inform where the slow down is.
Ava Chow
CC BY-SA 4.0
2021-07-17T13:06:00.387Z
Hi Andrew, infrastructures developers may have infinite reasons for having a private, permanent, regtest network.
The debug (=all) doesn't highlight where bitcoincore is spending time to generate blocks. I'll try with bench.
JonSnow
CC BY-SA 4.0
2022-03-21T06:15:29.543Z
Hey @JonSnow, have you had any luck with the benchmark tests? I am experiencing the same issue and before I start investigating on my own, I would like to hear if you found something! Thank you in advance!
YoshiJaeger
<bitcoin-core><bitcoind><regtest>
Regtest at height 120k took 600ms to generate a block
JonSnow
# Regtest at height 120k took 600ms to generate a block

(Asked by: username_0 on 2021-07-16)

Just doing

```
while :
do
 time bitcoin-cli generatetoaddress 1 <non_local_wallet_address>
 bitcoin-cli getblockcount
done

```

brings regtest blockgen times up to 600ms when generating a block at the height 120k, even with all empty blocks.

I have noted down the following numbers:

```
height, gen-time
800 -> 7ms
5500 -> 18ms
11000 -> 31ms
22000 -> 65ms
37000 -> 110ms

```

and so on.

This makes my test suite slowing down a lot, over time.
Is this something we can deal with?

Thanks!

**Tags:** bitcoin-core, bitcoind, regtest

> **Comments:**
> **username_1**: I can confirm this behavior. The difficulty is the same in regtest, so I don't think this should be happening.  Unfortunately, I cannot provide any more help apart from suggesting to restructure your suite so that it does use 120k blocks.  
> **username_1**: This is probably not related to block height. Because running `invalidate` and mining again from genesis does not help.  
> **username_2**: Why do you need 120k blocks for a test?  
> **username_2**: If you add `-debug=bench` to your `bitcoind` command, then the debug.log file will contain log lines with benchmarks for some part of the block generation process. That may help inform where the slow down is.  
> **username_0**: Hi Andrew, infrastructures developers may have infinite reasons for having a private, permanent, regtest network. The debug (=all) doesn't highlight where bitcoincore is spending time to generate blocks. I'll try with bench.  
> **username_3**: Hey @username_0, have you had any luck with the benchmark tests? I am experiencing the same issue and before I start investigating on my own, I would like to hear if you found something! Thank you in advance!  

---

## 0 answers

