aboutsummaryrefslogtreecommitdiffstats
path: root/ManyFunctionsGenerator.py
diff options
context:
space:
mode:
authorPaweł Bylica <pawel.bylica@imapp.pl>2015-02-16 22:26:54 +0800
committerPaweł Bylica <pawel.bylica@imapp.pl>2015-02-16 22:26:54 +0800
commitfc4a548d6f715a1502e0d5eff1b679e79f8cf243 (patch)
tree2a99b313f3abb7db6f540ef4681d3013c6222958 /ManyFunctionsGenerator.py
parent600b38224ea1592af9a8348b082abb996ee5ef76 (diff)
downloaddexon-solidity-fc4a548d6f715a1502e0d5eff1b679e79f8cf243.tar
dexon-solidity-fc4a548d6f715a1502e0d5eff1b679e79f8cf243.tar.gz
dexon-solidity-fc4a548d6f715a1502e0d5eff1b679e79f8cf243.tar.bz2
dexon-solidity-fc4a548d6f715a1502e0d5eff1b679e79f8cf243.tar.lz
dexon-solidity-fc4a548d6f715a1502e0d5eff1b679e79f8cf243.tar.xz
dexon-solidity-fc4a548d6f715a1502e0d5eff1b679e79f8cf243.tar.zst
dexon-solidity-fc4a548d6f715a1502e0d5eff1b679e79f8cf243.zip
ManyFunctions performance test: ~200 functions in a contract, half of them are called randomly
Diffstat (limited to 'ManyFunctionsGenerator.py')
-rw-r--r--ManyFunctionsGenerator.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/ManyFunctionsGenerator.py b/ManyFunctionsGenerator.py
new file mode 100644
index 00000000..93eef784
--- /dev/null
+++ b/ManyFunctionsGenerator.py
@@ -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) \ No newline at end of file