aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGav Wood <g@ethdev.com>2015-02-13 18:29:26 +0800
committerGav Wood <g@ethdev.com>2015-02-13 18:29:26 +0800
commit238d7ccc014ba91488b2e33740e8479ebe969c10 (patch)
tree5fa99f41ad25a803e4e6fcb486e87c3d6b8b4dfd
parent9f1515e9111627b5358cbacd0eb2cba8ed08a34d (diff)
parentcdb7565707ccfc960a30fd403570f21f15d08253 (diff)
downloaddexon-solidity-238d7ccc014ba91488b2e33740e8479ebe969c10.tar.gz
dexon-solidity-238d7ccc014ba91488b2e33740e8479ebe969c10.tar.zst
dexon-solidity-238d7ccc014ba91488b2e33740e8479ebe969c10.zip
Merge pull request #1039 from CJentzsch/performanceTests
Performance test
-rw-r--r--vm.cpp26
-rw-r--r--vmPerformanceTestFiller.json38
2 files changed, 64 insertions, 0 deletions
diff --git a/vm.cpp b/vm.cpp
index f15dc048..faab4812 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -513,13 +513,39 @@ BOOST_AUTO_TEST_CASE(vmSystemOperationsTest)
dev::test::executeTests("vmSystemOperationsTest", "/VMTests", dev::test::doVMTests);
}
+BOOST_AUTO_TEST_CASE(vmPerformanceTest)
+{
+ for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i)
+ {
+ string arg = boost::unit_test::framework::master_test_suite().argv[i];
+ if (arg == "--performance")
+ {
+ auto start = chrono::steady_clock::now();
+
+ dev::test::executeTests("vmPerformanceTest", "/VMTests", dev::test::doVMTests);
+
+ auto end = chrono::steady_clock::now();
+ chrono::milliseconds duration(chrono::duration_cast<chrono::milliseconds>(end - start));
+ cnote << "test duration: " << duration.count() << " milliseconds.\n";
+ }
+ }
+}
+
BOOST_AUTO_TEST_CASE(vmInputLimitsTest1)
{
for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i)
{
string arg = boost::unit_test::framework::master_test_suite().argv[i];
if (arg == "--inputlimits")
+ {
+ auto start = chrono::steady_clock::now();
+
dev::test::executeTests("vmInputLimitsTest1", "/VMTests", dev::test::doVMTests);
+
+ auto end = chrono::steady_clock::now();
+ chrono::milliseconds duration(chrono::duration_cast<chrono::milliseconds>(end - start));
+ cnote << "test duration: " << duration.count() << " milliseconds.\n";
+ }
}
}
diff --git a/vmPerformanceTestFiller.json b/vmPerformanceTestFiller.json
new file mode 100644
index 00000000..7cfe659d
--- /dev/null
+++ b/vmPerformanceTestFiller.json
@@ -0,0 +1,38 @@
+{
+ "ackermann33": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "100000000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : "1",
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : "0",
+ "//" : "contract PerformanceTester {",
+ "//" : " function ackermann(uint m, uint n) returns (uint) {",
+ "//" : " if (m == 0)",
+ "//" : " return n + 1;",
+ "//" : " if (n == 0)",
+ "//" : " return ackermann(m - 1, 1);",
+ "//" : " return ackermann(m - 1, ackermann(m, n - 1));",
+ "//" : " }",
+ "//" : "}",
+ "code" : "0x60e060020a6000350480632839e92814601457005b6020600435602435602a565b8060005260206000f35b6000826000146037576041565b8160010190506076565b81600014604c57605e565b6058600184036001602a565b90506076565b607360018403606f8560018603602a565b602a565b90505b9291505056",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "0x2839e92800000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000003",
+ "gasPrice" : "100000000000000",
+ "gas" : "100000000000"
+ }
+ }
+}