Skip to content

Commit 600943e

Browse files
jrebackwesm
authored andcommitted
TST: changed rows to test in hdfstore vbench to 25k from 100k
added data_columns test
1 parent fc53067 commit 600943e

File tree

1 file changed

+64
-51
lines changed

1 file changed

+64
-51
lines changed

vb_suite/hdfstore_bench.py

Lines changed: 64 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ def remove(f):
1919
# get from a store
2020

2121
setup1 = common_setup + """
22-
index = [rands(10) for _ in xrange(100000)]
23-
df = DataFrame({'float1' : randn(100000),
24-
'float2' : randn(100000)},
22+
index = [rands(10) for _ in xrange(25000)]
23+
df = DataFrame({'float1' : randn(25000),
24+
'float2' : randn(25000)},
2525
index=index)
2626
remove(f)
2727
store = HDFStore(f)
@@ -36,9 +36,9 @@ def remove(f):
3636
# write to a store
3737

3838
setup2 = common_setup + """
39-
index = [rands(10) for _ in xrange(100000)]
40-
df = DataFrame({'float1' : randn(100000),
41-
'float2' : randn(100000)},
39+
index = [rands(10) for _ in xrange(25000)]
40+
df = DataFrame({'float1' : randn(25000),
41+
'float2' : randn(25000)},
4242
index=index)
4343
remove(f)
4444
store = HDFStore(f)
@@ -52,12 +52,12 @@ def remove(f):
5252
# get from a store (mixed)
5353

5454
setup3 = common_setup + """
55-
index = [rands(10) for _ in xrange(100000)]
56-
df = DataFrame({'float1' : randn(100000),
57-
'float2' : randn(100000),
58-
'string1' : ['foo'] * 100000,
59-
'bool1' : [True] * 100000,
60-
'int1' : np.random.randint(0, 1000000, size=100000)},
55+
index = [rands(10) for _ in xrange(25000)]
56+
df = DataFrame({'float1' : randn(25000),
57+
'float2' : randn(25000),
58+
'string1' : ['foo'] * 25000,
59+
'bool1' : [True] * 25000,
60+
'int1' : np.random.randint(0, 250000, size=25000)},
6161
index=index)
6262
remove(f)
6363
store = HDFStore(f)
@@ -73,12 +73,12 @@ def remove(f):
7373
# write to a store (mixed)
7474

7575
setup4 = common_setup + """
76-
index = [rands(10) for _ in xrange(100000)]
77-
df = DataFrame({'float1' : randn(100000),
78-
'float2' : randn(100000),
79-
'string1' : ['foo'] * 100000,
80-
'bool1' : [True] * 100000,
81-
'int1' : np.random.randint(0, 1000000, size=100000)},
76+
index = [rands(10) for _ in xrange(25000)]
77+
df = DataFrame({'float1' : randn(25000),
78+
'float2' : randn(25000),
79+
'string1' : ['foo'] * 25000,
80+
'bool1' : [True] * 25000,
81+
'int1' : np.random.randint(0, 250000, size=25000)},
8282
index=index)
8383
remove(f)
8484
store = HDFStore(f)
@@ -92,12 +92,12 @@ def remove(f):
9292
# get from a table (mixed)
9393

9494
setup5 = common_setup + """
95-
index = [rands(10) for _ in xrange(100000)]
96-
df = DataFrame({'float1' : randn(100000),
97-
'float2' : randn(100000),
98-
'string1' : ['foo'] * 100000,
99-
'bool1' : [True] * 100000,
100-
'int1' : np.random.randint(0, 1000000, size=100000)},
95+
index = [rands(10) for _ in xrange(25000)]
96+
df = DataFrame({'float1' : randn(25000),
97+
'float2' : randn(25000),
98+
'string1' : ['foo'] * 25000,
99+
'bool1' : [True] * 25000,
100+
'int1' : np.random.randint(0, 250000, size=25000)},
101101
index=index)
102102
103103
remove(f)
@@ -114,12 +114,12 @@ def remove(f):
114114
# write to a table (mixed)
115115

116116
setup6 = common_setup + """
117-
index = [rands(10) for _ in xrange(100000)]
118-
df = DataFrame({'float1' : randn(100000),
119-
'float2' : randn(100000),
120-
'string1' : ['foo'] * 100000,
121-
'bool1' : [True] * 100000,
122-
'int1' : np.random.randint(0, 100000, size=100000)},
117+
index = [rands(10) for _ in xrange(25000)]
118+
df = DataFrame({'float1' : randn(25000),
119+
'float2' : randn(25000),
120+
'string1' : ['foo'] * 25000,
121+
'bool1' : [True] * 25000,
122+
'int1' : np.random.randint(0, 25000, size=25000)},
123123
index=index)
124124
remove(f)
125125
store = HDFStore(f)
@@ -133,9 +133,9 @@ def remove(f):
133133
# select from a table
134134

135135
setup7 = common_setup + """
136-
index = [rands(10) for _ in xrange(100000)]
137-
df = DataFrame({'float1' : randn(100000),
138-
'float2' : randn(100000) },
136+
index = [rands(10) for _ in xrange(25000)]
137+
df = DataFrame({'float1' : randn(25000),
138+
'float2' : randn(25000) },
139139
index=index)
140140
141141
remove(f)
@@ -152,9 +152,9 @@ def remove(f):
152152
# write to a table
153153

154154
setup8 = common_setup + """
155-
index = [rands(10) for _ in xrange(100000)]
156-
df = DataFrame({'float1' : randn(100000),
157-
'float2' : randn(100000) },
155+
index = [rands(10) for _ in xrange(25000)]
156+
df = DataFrame({'float1' : randn(25000),
157+
'float2' : randn(25000) },
158158
index=index)
159159
remove(f)
160160
store = HDFStore(f)
@@ -168,7 +168,7 @@ def remove(f):
168168
# get from a table (wide)
169169

170170
setup9 = common_setup + """
171-
df = DataFrame(np.random.randn(100000,200))
171+
df = DataFrame(np.random.randn(25000,100))
172172
173173
remove(f)
174174
store = HDFStore(f)
@@ -184,7 +184,7 @@ def remove(f):
184184
# write to a table (wide)
185185

186186
setup10 = common_setup + """
187-
df = DataFrame(np.random.randn(100000,200))
187+
df = DataFrame(np.random.randn(25000,100))
188188
189189
remove(f)
190190
store = HDFStore(f)
@@ -195,16 +195,15 @@ def remove(f):
195195
start_date=start_date)
196196

197197
#----------------------------------------------------------------------
198-
# get from a table (wide) (indexed)
198+
# get from a table (wide)
199199

200200
setup11 = common_setup + """
201-
index = date_range('1/1/2000', periods = 100000)
202-
df = DataFrame(np.random.randn(100000,200), index = index)
201+
index = date_range('1/1/2000', periods = 25000)
202+
df = DataFrame(np.random.randn(25000,100), index = index)
203203
204204
remove(f)
205205
store = HDFStore(f)
206206
store.append('df11',df)
207-
store.create_table_index('df11')
208207
"""
209208

210209
query_store_table_wide = Benchmark(
@@ -213,18 +212,17 @@ def remove(f):
213212

214213

215214
#----------------------------------------------------------------------
216-
# query from a table (indexed)
215+
# query from a table
217216

218217
setup12 = common_setup + """
219-
index = date_range('1/1/2000', periods = 100000)
220-
df = DataFrame({'float1' : randn(100000),
221-
'float2' : randn(100000) },
218+
index = date_range('1/1/2000', periods = 25000)
219+
df = DataFrame({'float1' : randn(25000),
220+
'float2' : randn(25000) },
222221
index=index)
223222
224223
remove(f)
225224
store = HDFStore(f)
226225
store.append('df12',df)
227-
store.create_table_index('df12')
228226
"""
229227

230228
query_store_table = Benchmark(
@@ -235,8 +233,8 @@ def remove(f):
235233
# select from a panel table
236234

237235
setup13 = common_setup + """
238-
p = Panel(randn(20, 1000, 1000), items= [ 'Item%03d' % i for i in xrange(20) ],
239-
major_axis=date_range('1/1/2000', periods=1000), minor_axis = [ 'E%03d' % i for i in xrange(1000) ])
236+
p = Panel(randn(20, 1000, 25), items= [ 'Item%03d' % i for i in xrange(20) ],
237+
major_axis=date_range('1/1/2000', periods=1000), minor_axis = [ 'E%03d' % i for i in xrange(25) ])
240238
241239
remove(f)
242240
store = HDFStore(f)
@@ -252,8 +250,8 @@ def remove(f):
252250
# write to a panel table
253251

254252
setup14 = common_setup + """
255-
p = Panel(randn(20, 1000, 1000), items= [ 'Item%03d' % i for i in xrange(20) ],
256-
major_axis=date_range('1/1/2000', periods=1000), minor_axis = [ 'E%03d' % i for i in xrange(1000) ])
253+
p = Panel(randn(20, 1000, 25), items= [ 'Item%03d' % i for i in xrange(20) ],
254+
major_axis=date_range('1/1/2000', periods=1000), minor_axis = [ 'E%03d' % i for i in xrange(25) ])
257255
258256
remove(f)
259257
store = HDFStore(f)
@@ -262,3 +260,18 @@ def remove(f):
262260
write_store_table_panel = Benchmark(
263261
"store.append('p2',p)", setup14, cleanup="store.close()",
264262
start_date=start_date)
263+
264+
#----------------------------------------------------------------------
265+
# write to a table (data_columns)
266+
267+
setup15 = common_setup + """
268+
df = DataFrame(np.random.randn(25000,10),columns = [ 'C%03d' % i for i in xrange(10) ])
269+
270+
remove(f)
271+
store = HDFStore(f)
272+
"""
273+
274+
write_store_table_dc = Benchmark(
275+
"store.append('df15',df,data_columns=True)", setup15, cleanup="store.close()",
276+
start_date=start_date)
277+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy