Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit b3006b2

Browse files
committed
profile_vm defautls to profiling
1 parent c44fc46 commit b3006b2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ethereum/tests/profile_vm.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
import pstats
77
import StringIO
88
import time
9-
from ethereum.utils import sha3_call_counter, sha3
10-
from ethereum.slogging import get_logger, configure_logging, get_configuration
9+
from ethereum.utils import sha3
10+
from ethereum.slogging import get_logger
1111
logger = get_logger()
12-
import sys
1312

1413

1514
def do_test_vm(filename, testname=None, testdata=None, limit=99999999, profiler=None):
1615
logger.debug('running test:%r in %r' % (testname, filename))
1716
testutils.run_vm_test(testutils.fixture_to_bytes(testdata), testutils.VERIFY, profiler=profiler)
1817

1918
if __name__ == '__main__':
20-
num = 5000
19+
num = 1000
20+
print 'profile_vm.py [no_cprofile]'
2121
print 'loading tests'
2222
fixtures = testutils.get_tests_from_file_or_dir(
2323
os.path.join(testutils.fixture_path, 'VMTests'))
@@ -36,7 +36,7 @@ def run(profiler=None):
3636
print 'ran %d tests' % i
3737
print 'test key', sha3(seen).encode('hex')
3838

39-
if len(sys.argv) == 2:
39+
if len(sys.argv) == 1:
4040
pr = cProfile.Profile()
4141
run(pr)
4242
s = StringIO.StringIO()
@@ -45,6 +45,8 @@ def run(profiler=None):
4545
ps.print_stats(50)
4646
print s.getvalue()
4747
else:
48+
# pypy version
49+
from ethereum.utils import sha3_call_counter
4850
st = time.time()
4951
run()
5052
print

0 commit comments

Comments
 (0)