8000 PERF: construct DataFrame with string array and dtype=str by topper-123 · Pull Request #36432 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

PERF: construct DataFrame with string array and dtype=str #36432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add ASVs
  • Loading branch information
topper-123 committed Sep 19, 2020
commit 256ad703a46462bf5fe2b54ac9cc01da69934142
17 changes: 12 additions & 5 deletions asv_bench/benchmarks/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ class Construction:
param_names = ["dtype"]

def setup(self, dtype):
self.data = tm.rands_array(nchars=10 ** 5, size=10)
self.series_arr = tm.rands_array(nchars=10, size=10 ** 5)
self.frame_arr = self.series_arr.reshape((50_000, 2)).copy()

def time_construction(self, dtype):
Series(self.data, dtype=dtype)
def time_series_construction(self, dtype):
Series(self.series_arr, dtype=dtype)

def peakmem_construction(self, dtype):
Series(self.data, dtype=dtype)
def peakmem_series_construction(self, dtype):
Series(self.series_arr, dtype=dtype)

def time_frame_construction(self, dtype):
DataFrame(self.frame_arr, dtype=dtype)

def peakmem_frame_construction(self, dtype):
DataFrame(self.frame_arr, dtype=dtype)


class Methods:
Expand Down
0