Browse Source

Timing for EVM.

cl-refactor
Gav Wood 11 years ago
parent
commit
9297669549
  1. 2
      alethzero/MainWin.cpp
  2. 13
      exp/main.cpp
  3. 6
      libethereum/Executive.cpp

2
alethzero/MainWin.cpp

@ -700,7 +700,7 @@ void Main::refreshBalances()
auto denom = m_client->stateAt(coinsAddr, sha3(h256(n).asBytes()));
if (denom == 0)
denom = 1;
cdebug << n << addr << denom << sha3(h256(n).asBytes());
// cdebug << n << addr << denom << sha3(h256(n).asBytes());
altCoins[addr] = make_tuple(fromRaw(n), 0, denom);
}
for (auto i: m_myKeys)

13
exp/main.cpp

@ -23,22 +23,13 @@
#include <libethential/Log.h>
#include <libethential/Common.h>
#include <libethential/CommonData.h>
#include <libevm/VM.h>
#include "BuildInfo.h"
using namespace std;
using namespace eth;
int main(int, char**)
{
u256 z = 0;
u256 s = 7;
u256 ms = z - s;
s256 ams = -7;
s256 sms = u2s(ms);
cnote << sms;
cnote << ams;
cnote << ms;
u256 t = 3;
s256 st = u2s(t);
cnote << ms << t << (sms % t) << sms << st << (s2u(sms % st) + 70);
return 0;
}

6
libethereum/Executive.cpp

@ -19,6 +19,7 @@
* @date 2014
*/
#include <boost/timer.hpp>
#include <libevm/VM.h>
#include "Executive.h"
#include "State.h"
@ -84,7 +85,7 @@ bool Executive::setup(bytesConstRef _rlp)
if (startGasUsed + m_t.gas > m_s.m_currentBlock.gasLimit)
{
clog(StateChat) << "Too much gas used in this block: Require <" << (m_s.m_currentBlock.gasLimit - startGasUsed) << " Got" << m_t.gas;
throw BlockGasLimitReached();
// throw BlockGasLimitReached();
}
// Increment associated nonce for sender.
@ -165,6 +166,8 @@ bool Executive::go(OnOpFunc const& _onOp)
{
if (m_vm)
{
boost::timer t;
auto sgas = m_vm->gas();
bool revert = false;
try
{
@ -192,6 +195,7 @@ bool Executive::go(OnOpFunc const& _onOp)
{
clog(StateChat) << "std::exception in VM: " << _e.what();
}
cnote << "VM took:" << t.elapsed() << "; gas used: " << (sgas - m_endGas);
// Write state out only in the case of a non-excepted transaction.
if (revert)

Loading…
Cancel
Save