Skip to content

PERF: more realistic np datetime c benchmark #58165

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
Changes from all commits
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
8 changes: 8 additions & 0 deletions asv_bench/benchmarks/tslibs/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ class TimeGetTimedeltaField:
def setup(self, size, field):
arr = np.random.randint(0, 10, size=size, dtype="i8")
self.i8data = arr
arr = np.random.randint(-86400 * 1_000_000_000, 0, size=size, dtype="i8")
self.i8data_negative = arr

def time_get_timedelta_field(self, size, field):
get_timedelta_field(self.i8data, field)

def time_get_timedelta_field_negative_td(self, size, field):
get_timedelta_field(self.i8data_negative, field)


class TimeGetDateField:
params = [
Expand Down Expand Up @@ -72,3 +77,6 @@ def setup(self, size, side, period, freqstr, month_kw):

def time_get_start_end_field(self, size, side, period, freqstr, month_kw):
get_start_end_field(self.i8data, self.attrname, freqstr, month_kw=month_kw)


from ..pandas_vb_common import setup # noqa: F401 isort:skip