causes of sudden changes in consumption time
- Dominant language
- Python
- Stars
- 5.5k
- Forks
- 1.7k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 2
Description
* Version: 5.17.0
* Python: 3.7
* OS: linux
## output
```
100%|██████████| 500/500 [04:41<00:00, 1.77it/s]
total time cost 281.79
```

### What was wrong?
* The code which produced the problem
```python
from web3 import Web3
from tqdm import tqdm
WSADDRESS = 'ws://xxx.xx.xxx.xx:8545'
w3 = Web3(Web3.WebsocketProvider(WSADDRESS, websocket_timeout=60))
address = "0xa8f9c7ff9f605f401bde6659fd18d9a0d0a802c5"
sample_txs = sampling_transactions(address, use_sampling=True, sample_count=500) # sample first 500 transactions
# caller_tracer.js is from https://github.com/ethereum/go-ethereum/blob/master/eth/tracers/js/internal/tracers/call_tracer_legacy.js
with open('./caller_tracer.js', 'r') as f:
callTracer = f.read()
def trace_transaction(tx):
return w3.provider.make_request('debug_traceTransaction', [
tx,
{
'tracer': callTracer,
'timeout': '60000s'
}
])
time_used = []
ts = time.time()
for tx in tqdm(sample_txs):
s = time.time()
trace_transaction(tx['transaction_hash'])
e = time.time()
time_used.append(e-s)
te = time.time()
print("total time cost %.2f"%(te-ts))
# draw transaction index vs time_used
# draw transaction index vs accumulated time
```
* What type of node you were connecting to.
A node on a different computer (full sync), so I have to use Websockets.
**I want to know the reason and how to fix it, thanks a lot**
Contributor guide
Assessment
This issue has not been assessed yet.