Browse Source

Merge pull request #1039 from CJentzsch/performanceTests

Performance test
cl-refactor
Gav Wood 10 years ago
parent
commit
e2c088942c
  1. 26
      test/vm.cpp
  2. 38
      test/vmPerformanceTestFiller.json

26
test/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";
}
}
}

38
test/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"
}
}
}
Loading…
Cancel
Save