Skip to content

CLN/PERF: clean-up of the benchmarks #14099

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 20 commits into from
Dec 10, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Next Next commit
Clean-up constructor benchmarks
  • Loading branch information
jorisvandenbossche committed Dec 10, 2016
commit cce95ee0f667a3de60923b0636df487f20571872
46 changes: 12 additions & 34 deletions asv_bench/benchmarks/ctors.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,30 @@
from .pandas_vb_common import *


class frame_constructor_ndarray(object):
class Constructors(object):
goal_time = 0.2

def setup(self):
self.arr = np.random.randn(100, 100)
self.arr_str = np.array(['foo', 'bar', 'baz'], dtype=object)

def time_frame_constructor_ndarray(self):
DataFrame(self.arr)


class ctor_index_array_string(object):
goal_time = 0.2

def setup(self):
self.data = np.array(['foo', 'bar', 'baz'], dtype=object)

def time_ctor_index_array_string(self):
Index(self.data)


class series_constructor_ndarray(object):
goal_time = 0.2

def setup(self):
self.data = np.random.randn(100)
self.index = Index(np.arange(100))

def time_series_constructor_ndarray(self):
Series(self.data, index=self.index)
self.s = Series(([Timestamp('20110101'), Timestamp('20120101'),
Timestamp('20130101')] * 1000))

def time_frame_from_ndarray(self):
DataFrame(self.arr)

class dtindex_from_series_ctor(object):
goal_time = 0.2
def time_series_from_ndarray(self):
pd.Series(self.data, index=self.index)

def setup(self):
self.s = Series(([Timestamp('20110101'), Timestamp('20120101'), Timestamp('20130101')] * 1000))
def time_index_from_array_string(self):
Index(self.arr_str)

def time_dtindex_from_series_ctor(self):
def time_dtindex_from_series(self):
DatetimeIndex(self.s)


class index_from_series_ctor(object):
goal_time = 0.2

def setup(self):
self.s = Series(([Timestamp('20110101'), Timestamp('20120101'), Timestamp('20130101')] * 1000))

def time_index_from_series_ctor(self):
def time_dtindex_from_series2(self):
Index(self.s)
Loading