292
292
print "Compression library:", complib
294
294
print "Suffling..."
297
297
if psyco_imported and usepsyco:
298
298
psyco.bind(createFile)
299
(rowsw, rowsz) = createFile(file, nrows, filters,
299
(rowsw, rowsz) = createFile(file, nrows, filters,
300
300
atom, recsize, index, verbose)
302
302
cpu2 = time.clock()
303
tapprows = round(t2-t1, 3)
304
cpuapprows = round(cpu2-cpu1, 3)
303
tapprows = round(t2-t1, 3)
304
cpuapprows = round(cpu2-cpu1, 3)
305
305
tpercent = int(round(cpuapprows/tapprows, 2)*100)
306
print "Rows written:", rowsw, " Row size:", rowsz
307
print "Time writing rows: %s s (real) %s s (cpu) %s%%" % \
306
print "Rows written:", rowsw, " Row size:", rowsz
307
print "Time writing rows: %s s (real) %s s (cpu) %s%%" % \
308
308
(tapprows, cpuapprows, tpercent)
309
print "Write rows/sec: ", int(rowsw / float(tapprows))
310
print "Write KB/s :", int(rowsw * rowsz / (tapprows * 1024))
309
print "Write rows/sec: ", int(rowsw / float(tapprows))
310
print "Write KB/s :", int(rowsw * rowsz / (tapprows * 1024))
313
313
if psyco_imported and usepsyco:
314
314
psyco.bind(readFile)
315
315
psyco.bind(searchFile)
317
317
cpu1 = time.clock()
319
319
(rowsr, uncomprB, niter) = searchFile(file, atom, verbose, item)
321
321
for i in range(1):
322
322
(rowsr, rowsel, rowsz) = readFile(file, atom, niter, verbose)
324
324
cpu2 = time.clock()
325
treadrows = round(t2-t1, 3)
325
treadrows = round(t2-t1, 3)
326
326
cpureadrows = round(cpu2-cpu1, 3)
327
327
tpercent = int(round(cpureadrows/treadrows, 2)*100)
328
328
tMrows = rowsr/(1000*1000.)
329
329
sKrows = rowsel/1000.
330
print "Rows read:", rowsr, "Mread:", round(tMrows, 3), "Mrows"
331
print "Rows selected:", rowsel, "Ksel:", round(sKrows,3), "Krows"
332
print "Time reading rows: %s s (real) %s s (cpu) %s%%" % \
330
print "Rows read:", rowsr, "Mread:", round(tMrows, 3), "Mrows"
331
print "Rows selected:", rowsel, "Ksel:", round(sKrows,3), "Krows"
332
print "Time reading rows: %s s (real) %s s (cpu) %s%%" % \
333
333
(treadrows, cpureadrows, tpercent)
334
print "Read Mrows/sec: ", round(tMrows / float(treadrows), 3)
335
#print "Read KB/s :", int(rowsr * rowsz / (treadrows * 1024))
336
# print "Uncompr MB :", int(uncomprB / (1024 * 1024))
337
# print "Uncompr MB/s :", int(uncomprB / (treadrows * 1024 * 1024))
338
# print "Total chunks uncompr :", int(niter)
334
print "Read Mrows/sec: ", round(tMrows / float(treadrows), 3)
335
#print "Read KB/s :", int(rowsr * rowsz / (treadrows * 1024))
336
# print "Uncompr MB :", int(uncomprB / (1024 * 1024))
337
# print "Uncompr MB/s :", int(uncomprB / (treadrows * 1024 * 1024))
338
# print "Total chunks uncompr :", int(niter)