mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
ManyFunctions performance test: ~200 functions in a contract, half of them are called randomly
This commit is contained in:
parent
600b38224e
commit
fc4a548d6f
1485
ManyFunctions.sol
Normal file
1485
ManyFunctions.sol
Normal file
File diff suppressed because it is too large
Load Diff
24
ManyFunctionsGenerator.py
Normal file
24
ManyFunctionsGenerator.py
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
n = 100
|
||||
|
||||
splitNumBegin = 128 - (n / 2)
|
||||
i = 1
|
||||
|
||||
template = """
|
||||
function right{0}(uint seed) returns (uint) {{
|
||||
var r = nextRand(seed);
|
||||
if (r >= 2^{2})
|
||||
return right{1}(r);
|
||||
return left{1}(r);
|
||||
}}
|
||||
|
||||
function left{0}(uint seed) returns (uint) {{
|
||||
var r = nextRand(nextRand(seed));
|
||||
if (r >= 2^{2})
|
||||
return left{1}(r);
|
||||
return right{1}(r);
|
||||
}}
|
||||
"""
|
||||
|
||||
for i in range(1, n):
|
||||
print template.format(i, i + 1, i + splitNumBegin)
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user