From 35c034eb3195f36734c3a761c0c522bf93ba5002 Mon Sep 17 00:00:00 2001 From: fawce Date: Fri, 25 May 2012 12:42:29 -0400 Subject: [PATCH] shortened up the tests to make them more reasonable total runtime. --- vb_suite/zipline_bench_functions.py | 7 +++++++ vb_suite/ziplines.py | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/vb_suite/zipline_bench_functions.py b/vb_suite/zipline_bench_functions.py index 565dee73..c970f055 100644 --- a/vb_suite/zipline_bench_functions.py +++ b/vb_suite/zipline_bench_functions.py @@ -34,3 +34,10 @@ def load_ndict(): for i in xrange(1000000): nd[keyname % i] + +def mass_create_ndict(): + from zipline import ndict + data = dict(('a %d' % a,a) for a in xrange(1000)) + + for i in xrange(10000): + ndict(data) diff --git a/vb_suite/ziplines.py b/vb_suite/ziplines.py index 3f74d669..fd3fba0a 100644 --- a/vb_suite/ziplines.py +++ b/vb_suite/ziplines.py @@ -8,13 +8,20 @@ from zipline_bench_functions import * basic_zipline = Benchmark( 'run_basic_zipline()', setup=setup, - start_date=datetime(2012,4,15), + start_date=datetime(2012,5,15), name='basic_zipline_test' ) load_ndict = Benchmark( - 'load_ndict', + 'load_ndict()', setup=setup, start_date=datetime(2012,4,15), name='load_ndict' ) + +mass_create_ndict = Benchmark( + 'mass_create_ndict()', + setup=setup, + start_date=datetime(2012,5,1), + name='create_ndict' +)