From 869046cca7c731c92240e824e91b2770c93e9ce3 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Thu, 30 May 2019 17:25:09 +0300 Subject: [PATCH 1/4] PERF: fix asv import error --- asv_bench/benchmarks/groupby.py | 7 ++++++- asv_bench/benchmarks/io/parsers.py | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/asv_bench/benchmarks/groupby.py b/asv_bench/benchmarks/groupby.py index 4dfce079dd09c..df5cd8a34e674 100644 --- a/asv_bench/benchmarks/groupby.py +++ b/asv_bench/benchmarks/groupby.py @@ -6,10 +6,15 @@ import numpy as np from pandas import ( - Categorical, DataFrame, MultiIndex, Series, TimeGrouper, Timestamp, + Categorical, DataFrame, MultiIndex, Series, Timestamp, date_range, period_range) import pandas.util.testing as tm +try: + from pandas import TimeGrouper +except ImportError: + pass + method_blacklist = { 'object': {'median', 'prod', 'sem', 'cumsum', 'sum', 'cummin', 'mean', diff --git a/asv_bench/benchmarks/io/parsers.py b/asv_bench/benchmarks/io/parsers.py index 493955d394443..edba0358c821a 100644 --- a/asv_bench/benchmarks/io/parsers.py +++ b/asv_bench/benchmarks/io/parsers.py @@ -1,7 +1,11 @@ import numpy as np -from pandas._libs.tslibs.parsing import ( - _concat_date_cols, _does_string_look_like_datetime) +try: + from pandas._libs.tslibs.parsing import ( + _concat_date_cols, _does_string_look_like_datetime) +except ImportError: + # Avoid whole benchmark suite import failure on asv (currently 0.4) + pass class DoesStringLookLikeDatetime(object): From 3eac9854182f1ce7f015df4f13739b21251bcc47 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Thu, 30 May 2019 17:25:27 +0300 Subject: [PATCH 2/4] CI: run asv check on all builds --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index eee38dadfab90..17eaee5458af8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -97,10 +97,11 @@ jobs: - script: | export PATH=$HOME/miniconda3/bin:$PATH source activate pandas-dev + cd asv_bench + asv check -E existing git remote add upstream https://github.com/pandas-dev/pandas.git git fetch upstream if git diff upstream/master --name-only | grep -q "^asv_bench/"; then - cd asv_bench asv machine --yes ASV_OUTPUT="$(asv dev)" if [[ $(echo "$ASV_OUTPUT" | grep "failed") ]]; then From 3e1065302d1b6296095438d46deed0511d7ba66e Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Thu, 30 May 2019 17:50:07 +0300 Subject: [PATCH 3/4] PERF: since TimeGrouper was removed, remove benchmarks concerning it --- asv_bench/benchmarks/groupby.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/asv_bench/benchmarks/groupby.py b/asv_bench/benchmarks/groupby.py index df5cd8a34e674..3097ada6d2022 100644 --- a/asv_bench/benchmarks/groupby.py +++ b/asv_bench/benchmarks/groupby.py @@ -1,7 +1,6 @@ from functools import partial from itertools import product from string import ascii_letters -import warnings import numpy as np @@ -10,11 +9,6 @@ date_range, period_range) import pandas.util.testing as tm -try: - from pandas import TimeGrouper -except ImportError: - pass - method_blacklist = { 'object': {'median', 'prod', 'sem', 'cumsum', 'sum', 'cummin', 'mean', @@ -306,10 +300,6 @@ def setup(self): def time_multi_size(self): self.df.groupby(['key1', 'key2']).size() - def time_dt_timegrouper_size(self): - with warnings.catch_warnings(record=True): - self.df.groupby(TimeGrouper(key='dates', freq='M')).size() - def time_category_size(self): self.draws.groupby(self.cats).size() From 69a617ffe6d00b67766fb20ad595a81561f04855 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Thu, 30 May 2019 19:46:21 +0300 Subject: [PATCH 4/4] PERF: fix benchmark frame_methods.Iteration.mem_itertuples_to_list The runtime of the benchmark increased in asv 0.4 (which has upgraded asv.extern.asizeof), so bump the timeout upward. --- asv_bench/benchmarks/frame_methods.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/asv_bench/benchmarks/frame_methods.py b/asv_bench/benchmarks/frame_methods.py index 0c1d861ce0839..5b76eeba115a4 100644 --- a/asv_bench/benchmarks/frame_methods.py +++ b/asv_bench/benchmarks/frame_methods.py @@ -96,6 +96,8 @@ def time_dict_rename_both_axes(self): class Iteration: + # mem_itertuples_* benchmarks are slow + timeout = 120 def setup(self): N = 1000