Skip to content

Commit 7a35c4b

Browse files
committed
Add some benchmarks
1 parent be7af6b commit 7a35c4b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

asv_bench/benchmarks/timeseries.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,9 @@ def setup(self):
356356

357357
self.s = Series((['19MAY11', '19MAY11:00:00:00'] * 100000))
358358
self.s2 = self.s.str.replace(':\\S+$', '')
359-
self.numeric_data = Series([range(100000)])
360-
self.datetime_data = [dt.datetime(2010, 1, 1)] * 100000
359+
self.dup_numeric_data = Series([1000] * 100000)
360+
self.dup_string_data = ['2013-01-01'] * 100000
361+
self.dup_datetime_data = [dt.datetime(2010, 1, 1)] * 100000
361362

362363
def time_format_YYYYMMDD(self):
363364
to_datetime(self.stringsD, format='%Y%m%d')
@@ -383,11 +384,14 @@ def time_format_exact(self):
383384
def time_format_no_exact(self):
384385
to_datetime(self.s, format='%d%b%y', exact=False)
385386

386-
def time_cache_numeric_data(self):
387-
to_datetime(self.numeric_data)
387+
def time_cache_dup_numeric_data(self):
388+
to_datetime(self.dup_numeric_data, unit='s')
388389

389-
def time_cache_datetime_data(self):
390-
to_datetime(self.datetime_data)
390+
def time_cache_dup_datetime_data(self):
391+
to_datetime(self.dup_datetime_data)
392+
393+
def time_cache_dup_string_data(self):
394+
to_datetime(self.dup_string_data)
391395

392396

393397
class Offsets(object):

0 commit comments

Comments
 (0)