mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 00:56:31 +08:00
Add write benchmark, write more rows
This commit is contained in:
1 parent
1d604339fc
commit
0b8d690e75
1 file changed
+9
-5
@@ -135,18 +135,22 @@ class ParquetWriteDictionaries(object):
|
||||
|
||||
class ParquetManyColumns(object):
|
||||
|
||||
total_cells = 1000000
|
||||
total_cells = 10000000
|
||||
param_names = ('num_cols',)
|
||||
params = [100, 1000, 10000]
|
||||
|
||||
def setup(self, num_cols):
|
||||
num_rows = self.total_cells // num_cols
|
||||
table = pa.table({'c' + str(i): np.random.randn(num_rows)
|
||||
for i in range(num_cols)})
|
||||
self.table = pa.table({'c' + str(i): np.random.randn(num_rows)
|
||||
for i in range(num_cols)})
|
||||
|
||||
out = pa.BufferOutputStream()
|
||||
pq.write_table(table, out)
|
||||
pq.write_table(self.table, out)
|
||||
self.buf = out.getvalue()
|
||||
|
||||
def time_read_time(self, num_cols):
|
||||
def time_write(self, num_cols):
|
||||
out = pa.BufferOutputStream()
|
||||
pq.write_table(self.table, out)
|
||||
|
||||
def time_read(self, num_cols):
|
||||
pq.read_table(self.buf)
|
||||
Reference in new issue
Block a user