From 0c366a8453827c9e46482dd2b4dddd738981d70b Mon Sep 17 00:00:00 2001 From: gfyoung Date: Sun, 20 Jan 2019 00:05:17 +0000 Subject: [PATCH] TST: Add ASV benchmark for issue --- asv_bench/benchmarks/io/csv.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/asv_bench/benchmarks/io/csv.py b/asv_bench/benchmarks/io/csv.py index 771f2795334e1..d42a15d61fb0d 100644 --- a/asv_bench/benchmarks/io/csv.py +++ b/asv_bench/benchmarks/io/csv.py @@ -214,4 +214,23 @@ def time_baseline(self): names=list(string.digits[:9])) +class ReadCSVMemoryGrowth(BaseIO): + + chunksize = 20 + num_rows = 1000 + fname = "__test__.csv" + + def setup(self): + with open(self.fname, "w") as f: + for i in range(self.num_rows): + f.write("{i}\n".format(i=i)) + + def mem_parser_chunks(self): + # see gh-24805. + result = read_csv(self.fname, chunksize=self.chunksize) + + for _ in result: + pass + + from ..pandas_vb_common import setup # noqa: F401