Skip to content

Commit 0ca1bfc

Browse files
committed
Add benchmark
1 parent 9ba4131 commit 0ca1bfc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

python/benchmarks/convert_pandas.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,18 @@ def time_deserialize_from_buffer(self):
9090

9191
def time_deserialize_from_components(self):
9292
pa.deserialize_components(self.as_components)
93+
94+
95+
class SerializeDeserializePandas(object):
96+
97+
def setup(self):
98+
# 10 million length
99+
n = 10000000
100+
self.df = pd.DataFrame({'data': np.random.randn(n)})
101+
self.serialized = pa.serialize_pandas(self.df)
102+
103+
def time_serialize_pandas(self):
104+
pa.serialize_pandas(self.df)
105+
106+
def time_deserialize_pandas(self):
107+
pa.deserialize_pandas(self.serialized)

0 commit comments

Comments
 (0)