Skip to content
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

Add asv benchmarks for essential functions #23935

Merged
merged 8 commits into from
Nov 27, 2018

Conversation

qwhelan
Copy link
Contributor

@qwhelan qwhelan commented Nov 26, 2018

I've jury-rigged asv with coverage to enable automatic identification of what parts of the code base are lacking asv benchmark coverage and found a number of essential functions on my first pass:

  • pd.DataFrame.rename()
  • pd.cut() / pd.qcut()
  • .dot()
  • Any .plot() method other than line
  • Lots of .str methods
  • .corr() and .cov() (we're covering the rolling version, which is a different path than full-sample)
  • TimedeltaIndex

There's still a lot left, but the above represents about a 20% increase in benchmark coverage compared to baseline. (This is a little bit of a hand-wavy metric, as imports/defs/etc that are normally counted towards coverage are excluded unless explicitly run inside a benchmark, leading to very low benchmark coverage metrics in the neighborhood of 10%).

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@pep8speaks
Copy link

pep8speaks commented Nov 26, 2018

Hello @qwhelan! Thanks for updating the PR.

Comment last updated on November 26, 2018 at 23:13 Hours UTC

@gfyoung gfyoung added the Benchmark Performance (ASV) benchmarks label Nov 26, 2018
@mroeschke
Copy link
Member

Could you show the output of asv dev for these added benchmarks?

@qwhelan
Copy link
Contributor Author

qwhelan commented Nov 26, 2018

@mroeschke Sure, asv run is still doing the baseline run but here's the asv dev output with some of the irrelevant stuff excised. Times are very noisy due to a bug with asv on windows:

$ asv dev -b dot -b plot -b rename -b Cut -b Expanding -b EWM -b Correlation -b Covariance -b Methods -b Timedelta
· Discovering benchmarks
· Running 89 total benchmarks (1 commits * 1 environments * 89 benchmarks)
[  0.00%] ·· Benchmarking existing-py_home_chris_anaconda3_bin_python
[  0.56%] ··· binary_ops.Ops2.time_frame_dot                                                                                                                         125±0ms
[  1.12%] ··· binary_ops.Ops2.time_frame_series_dot                                                                                                                    0±0ns
[  1.69%] ··· binary_ops.Ops2.time_series_dot                                                                                                                          0±0ns
[  2.25%] ··· frame_methods.Rename.time_dict_rename_both_axes                                                                                                        734±0ms
[  2.81%] ··· frame_methods.Rename.time_rename_axis0                                                                                                                 531±0ms
[  3.37%] ··· frame_methods.Rename.time_rename_axis1                                                                                                                 500±0ms
[  3.93%] ··· frame_methods.Rename.time_rename_both_axes                                                                                                             719±0ms
[  4.49%] ··· frame_methods.Rename.time_rename_single                                                                                                                531±0ms
[ 10.11%] ··· plotting.FramePlotting.time_frame_plot                                                                                                                      ok
[ 10.11%] ··· ========= =========
                 kind
              --------- ---------
                 line    594±0ms
                 bar     609±0ms
                 area    1.11±0s
                 barh    625±0ms
                 hist    828±0ms
                 kde     2.03±0s
                 pie     547±0ms
               scatter   406±0ms
                hexbin   422±0ms
              ========= =========

[ 10.67%] ··· plotting.Misc.time_plot_andrews_curves                                                                                                                 1.64±0s
[ 11.24%] ··· plotting.SeriesPlotting.time_series_plot                                                                                                                    ok
[ 11.24%] ··· ====== =========
               kind
              ------ ---------
               line   734±0ms
               bar    625±0ms
               area   1.09±0s
               barh   609±0ms
               hist   750±0ms
               kde    1.98±0s
               pie    500±0ms
              ====== =========

[ 11.80%] ··· plotting.TimeseriesPlotting.time_plot_irregular                                                                                                        406±0ms
[ 12.36%] ··· plotting.TimeseriesPlotting.time_plot_regular                                                                                                          438±0ms
[ 12.92%] ··· plotting.TimeseriesPlotting.time_plot_regular_compat                                                                                                   406±0ms
[ 13.48%] ··· replace.Convert.time_replace                                                                                                                                ok
[ 13.48%] ··· ============= =========== ===========
              --                  replace_data
              ------------- -----------------------
               constructor   Timestamp   Timedelta
              ============= =========== ===========
                DataFrame       n/a       547±0ms
                  Series        n/a       547±0ms
              ============= =========== ===========

[ 14.04%] ··· reshape.Cut.time_cut_float                                                                                                                                  ok
[ 14.04%] ··· ====== ==========
               bins
              ------ ----------
                4     78.1±0ms
                10    78.1±0ms
               1000   203±0ms
              ====== ==========

[ 14.61%] ··· reshape.Cut.time_cut_int                                                                                                                                    ok
[ 14.61%] ··· ====== ==========
               bins
              ------ ----------
                4     93.8±0ms
                10    78.1±0ms
               1000   141±0ms
              ====== ==========

[ 15.17%] ··· reshape.Cut.time_qcut_float                                                                                                                                 ok
[ 15.17%] ··· ====== =========
               bins
              ------ ---------
                4     141±0ms
                10    141±0ms
               1000   266±0ms
              ====== =========

[ 15.73%] ··· reshape.Cut.time_qcut_int                                                                                                                                   ok
[ 15.73%] ··· ====== ==========
               bins
              ------ ----------
                4     109±0ms
                10    93.8±0ms
               1000   172±0ms
              ====== ==========

[ 16.29%] ··· rolling.EWMMethods.time_ewm                                                                                                                                 ok
[ 16.29%] ··· ============ ======== ============ =========== ============== =============
              --                                        dtype / method
              --------------------- -----------------------------------------------------
               contructor   window   int / mean   int / std   float / mean   float / std
              ============ ======== ============ =========== ============== =============
               DataFrame      10      31.2±0ms     46.9±0ms     31.2±0ms       31.2±0ms
               DataFrame     1000     31.2±0ms     46.9±0ms     31.2±0ms       31.2±0ms
                 Series       10      31.2±0ms     31.2±0ms     15.6±0ms       31.2±0ms
                 Series      1000     46.9±0ms     46.9±0ms     15.6±0ms       46.9±0ms
              ============ ======== ============ =========== ============== =============

[ 16.85%] ··· rolling.ExpandingMethods.time_expanding                                                                                                                     ok
[ 16.85%] ··· ============ ======== ========= ========== ========== ========== ========== ========== ========== ========== ==========
              --                                                                  dtype
              --------------------- -------------------------------------------------------------------------------------------------
               contructor   window    median     mean       max        min        std       count       skew       kurt       sum
              ============ ======== ========= ========== ========== ========== ========== ========== ========== ========== ==========
               DataFrame     int     266±0ms   15.6±0ms   31.2±0ms   15.6±0ms   15.6±0ms   46.9±0ms   15.6±0ms   15.6±0ms   15.6±0ms
               DataFrame    float    281±0ms   15.6±0ms   31.2±0ms   15.6±0ms   15.6±0ms   31.2±0ms   15.6±0ms   15.6±0ms   15.6±0ms
                 Series      int     234±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   15.6±0ms
                 Series     float    281±0ms   15.6±0ms   31.2±0ms   15.6±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   15.6±0ms
              ============ ======== ========= ========== ========== ========== ========== ========== ========== ========== ==========

[ 17.42%] ··· rolling.Methods.time_rolling                                                                                                                                ok
[ 17.42%] ··· ============ ======== ======= ========== ========== ========== ========== ========== ========== ========== ========== ==========
              --                                                                          method
              ----------------------------- --------------------------------------------------------------------------------------------------
               contructor   window   dtype    median      mean       max        min        std       count       skew       kurt       sum
              ============ ======== ======= ========== ========== ========== ========== ========== ========== ========== ========== ==========
               DataFrame      10      int    78.1±0ms   15.6±0ms   31.2±0ms   15.6±0ms   15.6±0ms   31.2±0ms   15.6±0ms   31.2±0ms   15.6±0ms
               DataFrame      10     float   78.1±0ms   15.6±0ms   15.6±0ms   15.6±0ms   15.6±0ms   31.2±0ms   15.6±0ms   15.6±0ms   15.6±0ms
               DataFrame     1000     int    141±0ms    15.6±0ms   15.6±0ms   15.6±0ms   15.6±0ms   15.6±0ms   15.6±0ms   15.6±0ms   15.6±0ms
               DataFrame     1000    float   188±0ms    31.2±0ms   15.6±0ms   31.2±0ms   31.2±0ms   31.2±0ms   15.6±0ms   15.6±0ms   15.6±0ms
                 Series       10      int    109±0ms    15.6±0ms   31.2±0ms   31.2±0ms   15.6±0ms   31.2±0ms   31.2±0ms   15.6±0ms   15.6±0ms
                 Series       10     float   93.8±0ms   15.6±0ms   31.2±0ms   15.6±0ms   31.2±0ms   15.6±0ms   31.2±0ms   31.2±0ms   15.6±0ms
                 Series      1000     int    172±0ms    31.2±0ms   31.2±0ms   31.2±0ms   46.9±0ms   31.2±0ms   31.2±0ms   15.6±0ms   31.2±0ms
                 Series      1000    float   156±0ms    15.6±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms
              ============ ======== ======= ========== ========== ========== ========== ========== ========== ========== ========== ==========

[ 17.98%] ··· rolling.VariableWindowMethods.time_rolling                                                                                                                  ok
[ 17.98%] ··· ============ ======== ======= ========== ========== ========== ========== ========== ========== ========== ========== ==========
              --                                                                          method
              ----------------------------- --------------------------------------------------------------------------------------------------
               contructor   window   dtype    median      mean       max        min        std       count       skew       kurt       sum
              ============ ======== ======= ========== ========== ========== ========== ========== ========== ========== ========== ==========
               DataFrame     50s      int    78.1±0ms   15.6±0ms   62.5±0ms   31.2±0ms   31.2±0ms   31.2±0ms   46.9±0ms   31.2±0ms   15.6±0ms
               DataFrame     50s     float   78.1±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms    0±0ns     46.9±0ms   15.6±0ms
               DataFrame      1h      int    156±0ms    15.6±0ms   46.9±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms
               DataFrame      1h     float   141±0ms    15.6±0ms   15.6±0ms   31.2±0ms   31.2±0ms   46.9±0ms   31.2±0ms   15.6±0ms   15.6±0ms
               DataFrame      1d      int    250±0ms    31.2±0ms   31.2±0ms   46.9±0ms   15.6±0ms   31.2±0ms   15.6±0ms   15.6±0ms   31.2±0ms
               DataFrame      1d     float   234±0ms    15.6±0ms   31.2±0ms   15.6±0ms   15.6±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms
                 Series      50s      int    93.8±0ms   15.6±0ms   31.2±0ms   31.2±0ms   15.6±0ms   31.2±0ms   31.2±0ms   15.6±0ms   15.6±0ms
                 Series      50s     float   78.1±0ms   15.6±0ms   31.2±0ms   31.2±0ms   31.2±0ms   15.6±0ms   31.2±0ms   31.2±0ms   31.2±0ms
                 Series       1h      int    156±0ms    15.6±0ms   15.6±0ms   15.6±0ms   31.2±0ms   15.6±0ms   15.6±0ms   15.6±0ms   31.2±0ms
                 Series       1h     float   156±0ms    15.6±0ms   46.9±0ms   31.2±0ms   31.2±0ms   31.2±0ms   15.6±0ms   31.2±0ms   31.2±0ms
                 Series       1d      int    188±0ms    31.2±0ms   15.6±0ms   31.2±0ms   31.2±0ms   15.6±0ms   31.2±0ms   31.2±0ms   31.2±0ms
                 Series       1d     float   266±0ms    15.6±0ms   31.2±0ms   31.2±0ms   31.2±0ms   31.2±0ms   46.9±0ms   46.9±0ms   31.2±0ms
              ============ ======== ======= ========== ========== ========== ========== ========== ========== ========== ========== ==========

[ 18.54%] ··· stat_ops.Correlation.time_corr                                                                                                                              ok
[ 18.54%] ··· ========== ========== ==========
              --             use_bottleneck
              ---------- ---------------------
                method      True      False
              ========== ========== ==========
               spearman   203±0ms    203±0ms
               kendall    922±0ms    938±0ms
               pearson    15.6±0ms   15.6±0ms
              ========== ========== ==========

[ 19.10%] ··· stat_ops.Correlation.time_corr_series                                                                                                                       ok
[ 19.10%] ··· ========== ========== ==========
              --             use_bottleneck
              ---------- ---------------------
                method      True      False
              ========== ========== ==========
               spearman   484±0ms    516±0ms
               kendall    484±0ms    500±0ms
               pearson    15.6±0ms   15.6±0ms
              ========== ========== ==========

[ 19.66%] ··· stat_ops.Covariance.time_cov_series                                                                                                                         ok
[ 19.66%] ··· ================ ==========
               use_bottleneck
              ---------------- ----------
                    True        15.6±0ms
                   False        46.9±0ms
              ================ ==========

[ 20.22%] ··· strings.Methods.time_center                                                                                                                            125±0ms
[ 20.79%] ··· strings.Methods.time_count                                                                                                                             109±0ms
[ 21.35%] ··· strings.Methods.time_endswith                                                                                                                         46.9±0ms
[ 21.91%] ··· strings.Methods.time_extract                                                                                                                           391±0ms
[ 22.47%] ··· strings.Methods.time_find                                                                                                                             93.8±0ms
[ 23.03%] ··· strings.Methods.time_findall                                                                                                                           219±0ms
[ 23.60%] ··· strings.Methods.time_get                                                                                                                              78.1±0ms
[ 24.72%] ··· strings.Methods.time_join                                                                                                                              125±0ms
[ 25.28%] ··· strings.Methods.time_len                                                                                                                              78.1±0ms
[ 25.84%] ··· strings.Methods.time_lower                                                                                                                            62.5±0ms
[ 26.40%] ··· strings.Methods.time_lstrip                                                                                                                           46.9±0ms
[ 26.97%] ··· strings.Methods.time_match                                                                                                                             109±0ms
[ 27.53%] ··· strings.Methods.time_normalize                                                                                                                        78.1±0ms
[ 28.09%] ··· strings.Methods.time_pad                                                                                                                               125±0ms
[ 28.65%] ··· strings.Methods.time_partition                                                                                                                         344±0ms
[ 29.21%] ··· strings.Methods.time_replace                                                                                                                          62.5±0ms
[ 29.78%] ··· strings.Methods.time_rfind                                                                                                                             125±0ms
[ 30.90%] ··· strings.Methods.time_rpartition                                                                                                                        344±0ms
[ 31.46%] ··· strings.Methods.time_rstrip                                                                                                                           46.9±0ms
[ 32.02%] ··· strings.Methods.time_slice                                                                                                                            62.5±0ms
[ 32.58%] ··· strings.Methods.time_startswith                                                                                                                       62.5±0ms
[ 33.15%] ··· strings.Methods.time_strip                                                                                                                            46.9±0ms
[ 33.71%] ··· strings.Methods.time_title                                                                                                                            78.1±0ms
[ 34.27%] ··· strings.Methods.time_translate                                                                                                                         172±0ms
[ 34.83%] ··· strings.Methods.time_upper                                                                                                                            62.5±0ms
[ 35.39%] ··· strings.Methods.time_wrap                                                                                                                              1.06±0s
[ 35.96%] ··· strings.Methods.time_zfill                                                                                                                            46.9±0ms
[ 36.52%] ··· timedelta.TimedeltaConstructor.time_from_components                                                                                                   15.6±0ms
[ 37.08%] ··· timedelta.TimedeltaConstructor.time_from_datetime_timedelta                                                                                              0±0ns
[ 37.64%] ··· timedelta.TimedeltaConstructor.time_from_int                                                                                                             0±0ns
[ 38.20%] ··· timedelta.TimedeltaConstructor.time_from_iso_format                                                                                                      0±0ns
[ 38.76%] ··· timedelta.TimedeltaConstructor.time_from_missing                                                                                                         0±0ns
[ 39.33%] ··· timedelta.TimedeltaConstructor.time_from_np_timedelta                                                                                                    0±0ns
[ 39.89%] ··· timedelta.TimedeltaConstructor.time_from_string                                                                                                          0±0ns
[ 40.45%] ··· timedelta.TimedeltaConstructor.time_from_unit                                                                                                            0±0ns
[ 41.01%] ··· timedelta.TimedeltaIndexing.time_align                                                                                                                15.6±0ms
[ 41.57%] ··· timedelta.TimedeltaIndexing.time_get_loc                                                                                                                 0±0ns
[ 42.13%] ··· timedelta.TimedeltaIndexing.time_intersection                                                                                                         15.6±0ms
[ 42.70%] ··· timedelta.TimedeltaIndexing.time_series_loc                                                                                                           15.6±0ms
[ 43.26%] ··· timedelta.TimedeltaIndexing.time_shallow_copy                                                                                                            0±0ns
[ 43.82%] ··· timedelta.TimedeltaIndexing.time_shape                                                                                                                   0±0ns
[ 44.38%] ··· timedelta.TimedeltaIndexing.time_union                                                                                                                   0±0ns
[ 44.94%] ··· timedelta.TimedeltaIndexing.time_unique                                                                                                                  0±0ns
[ 45.51%] ··· timedelta.TimedeltaOps.time_add_td_ts                                                                                                                 46.9±0ms
[ 46.07%] ··· timedelta.ToTimedelta.time_convert_int                                                                                                                   0±0ns
[ 46.63%] ··· timedelta.ToTimedelta.time_convert_string_days                                                                                                        31.2±0ms
[ 47.19%] ··· timedelta.ToTimedelta.time_convert_string_seconds                                                                                                     31.2±0ms
[ 47.75%] ··· timedelta.ToTimedeltaErrors.time_convert                                                                                                                    ok
[ 47.75%] ··· ======== ==========
               errors
              -------- ----------
               coerce   109±0ms
               ignore   93.8±0ms
              ======== ==========

[ 48.31%] ··· Setting up timedelta.py:82                                                                                                                                  ok
[ 48.31%] ··· timedelta.TimedeltaProperties.time_timedelta_days                                                                                                        0±0ns
[ 48.88%] ··· timedelta.TimedeltaProperties.time_timedelta_microseconds                                                                                                0±0ns
[ 49.44%] ··· timedelta.TimedeltaProperties.time_timedelta_nanoseconds                                                                                                 0±0ns
[ 50.00%] ··· timedelta.TimedeltaProperties.time_timedelta_seconds                                                                                                     0±0ns

@codecov
Copy link

codecov bot commented Nov 27, 2018

Codecov Report

Merging #23935 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23935   +/-   ##
=======================================
  Coverage   92.31%   92.31%           
=======================================
  Files         161      161           
  Lines       51471    51471           
=======================================
  Hits        47515    47515           
  Misses       3956     3956
Flag Coverage Δ
#multiple 90.7% <ø> (ø) ⬆️
#single 42.43% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee283fa...9b1a80f. Read the comment docs.

@qwhelan
Copy link
Contributor Author

qwhelan commented Nov 27, 2018

@mroeschke Nothing too shocking, but a reasonable fraction are demonstrating small slowdowns compared to v0.20.0:

       before           after         ratio
     [f6ee9acd]       [b7294dd3]
-      6.69±0.4ms      5.77±0.05ms     0.86  rolling.ExpandingMethods.time_expanding('Series', 'int', 'min')
-      6.78±0.3ms      5.79±0.02ms     0.85  rolling.ExpandingMethods.time_expanding('Series', 'int', 'max')
-      14.8±0.2ms       12.1±0.4ms     0.81  rolling.ExpandingMethods.time_expanding('Series', 'int', 'count')
-     1.60±0.02μs          915±2ns     0.57  timedelta.TimedeltaIndexing.time_shape
       before           after         ratio
     [f6ee9acd]       [b7294dd3]
+     10.3±0.03μs      20.8±0.05μs     2.02  timedelta.TimedeltaIndexing.time_shallow_copy
+       183±0.7μs          342±1μs     1.87  timedelta.TimedeltaIndexing.time_unique
+     17.1±0.02ms      30.2±0.05ms     1.76  rolling.EWMMethods.time_ewm('DataFrame', 1000, 'float', 'std')
+     17.1±0.04ms      30.2±0.05ms     1.76  rolling.EWMMethods.time_ewm('DataFrame', 10, 'float', 'std')
+      17.3±0.1ms       30.4±0.2ms     1.75  rolling.EWMMethods.time_ewm('DataFrame', 1000, 'int', 'std')
+     17.4±0.08ms       30.3±0.2ms     1.75  rolling.EWMMethods.time_ewm('DataFrame', 10, 'int', 'std')
+      21.4±0.1ms       33.3±0.2ms     1.56  rolling.EWMMethods.time_ewm('Series', 10, 'float', 'std')
+     21.5±0.08ms       33.2±0.1ms     1.55  rolling.EWMMethods.time_ewm('Series', 10, 'int', 'std')
+      21.4±0.1ms       33.0±0.2ms     1.55  rolling.EWMMethods.time_ewm('Series', 1000, 'float', 'std')
+      21.7±0.2ms       33.4±0.2ms     1.54  rolling.EWMMethods.time_ewm('Series', 1000, 'int', 'std')
+         257±6ms          368±3ms     1.43  reshape.Cut.time_cut_float(4)
+        382±20ms         532±20ms     1.39  reshape.Cut.time_qcut_int(4)
+      58.1±0.3ms       80.3±0.3ms     1.38  strings.Methods.time_get
+        394±30ms         536±30ms     1.36  reshape.Cut.time_qcut_int(10)
+     16.3±0.03μs      22.2±0.08μs     1.36  timedelta.TimedeltaIndexing.time_get_loc
+         574±1μs          751±2μs     1.31  timedelta.TimedeltaIndexing.time_union
+      1.08±0.01s       1.41±0.09s     1.30  plotting.SeriesPlotting.time_series_plot('line')
+         247±1μs          319±2μs     1.29  timedelta.TimedeltaIndexing.time_intersection
+         333±1ms          423±1ms     1.27  strings.Methods.time_rpartition
+         338±2ms          425±1ms     1.26  strings.Methods.time_partition
+       246±0.6μs        302±0.5μs     1.22  timedelta.ToTimedelta.time_convert_int
+        589±20ms         711±30ms     1.21  reshape.Cut.time_qcut_float(4)
+      93.1±0.3μs        110±0.5μs     1.18  binary_ops.Ops2.time_series_dot
+         369±1μs        428±0.8μs     1.16  stat_ops.Correlation.time_corr_series('pearson', True)
+         370±1μs        428±0.7μs     1.16  stat_ops.Correlation.time_corr_series('pearson', False)
+     1.59±0.01ms      1.82±0.01ms     1.15  timedelta.TimedeltaIndexing.time_align
+       153±0.3ms        175±0.2ms     1.14  stat_ops.Correlation.time_corr('spearman', True)
+       153±0.1ms        175±0.1ms     1.14  stat_ops.Correlation.time_corr('spearman', False)
+     2.15±0.02ms      2.43±0.02ms     1.13  rolling.ExpandingMethods.time_expanding('DataFrame', 'float', 'sum')
+      1.30±0.02s       1.44±0.03s     1.11  reshape.Cut.time_qcut_int(1000)

@jreback
Copy link
Contributor

jreback commented Nov 27, 2018

look ok to me. @topper-123 if you have any comments.

@mroeschke feel free to merge when satisfied.

@qwhelan
Copy link
Contributor Author

qwhelan commented Nov 27, 2018

@mroeschke And the asv dev output for the timedelta/datetime cut benchmarks:

$ asv dev -b cut_timedelta -b cut_datetime
· Discovering benchmarks
· Running 4 total benchmarks (1 commits * 1 environments * 4 benchmarks)
[  0.00%] ·· Benchmarking existing-py_home_chris_anaconda3_bin_python
[ 12.50%] ··· reshape.Cut.time_cut_datetime                                                                                                                               ok
[ 12.50%] ··· ====== ==========
               bins
              ------ ----------
                4     15.6±0ms
                10     0±0ns
               1000   46.9±0ms
              ====== ==========

[ 25.00%] ··· reshape.Cut.time_cut_timedelta                                                                                                                              ok
[ 25.00%] ··· ====== ==========
               bins
              ------ ----------
                4     15.6±0ms
                10    15.6±0ms
               1000   46.9±0ms
              ====== ==========

[ 37.50%] ··· reshape.Cut.time_qcut_datetime                                                                                                                              ok
[ 37.50%] ··· ====== ==========
               bins
              ------ ----------
                4     31.2±0ms
                10    15.6±0ms
               1000   46.9±0ms
              ====== ==========

[ 50.00%] ··· reshape.Cut.time_qcut_timedelta                                                                                                                             ok
[ 50.00%] ··· ====== ==========
               bins
              ------ ----------
                4      0±0ns
                10    15.6±0ms
               1000   62.5±0ms
              ====== ==========

@mroeschke mroeschke merged commit 0e7cf48 into pandas-dev:master Nov 27, 2018
@mroeschke
Copy link
Member

Great thanks @qwhelan! More benchmarks are always appreciated.

@topper-123
Copy link
Contributor

Look good. @qwhelan , you mention

Times are very noisy due to a bug with asv on windows:

I'm working on windows and experience very uneven results when running ASVs and I actually have more trust in doing timeit manually, which is a bit sad. Got any pointers on this bug? Can't find anything on the ASV Github issue list.

@qwhelan
Copy link
Contributor Author

qwhelan commented Nov 27, 2018

@topper-123 It's pretty simple - asv uses time.time(), which has a resolution of 15.6 ms on Windows (with the upside of being process time instead of wall time). The default target runtime is 10 ms, which causes some fun quantization noise as it is less than the clock resolution. Either target runtime needs to be increased by a couple orders of magnitude, or asv needs to use wall time for faster tests.

I've been punting on opening a PR on this as I'm waiting for comments on the one I already have open, but I have a small notebook demonstrating the quantization I threw together before I went on vacation. I'll try to post it later today.

@qwhelan qwhelan deleted the asv_coverage branch November 28, 2018 00:25
@qwhelan
Copy link
Contributor Author

qwhelan commented Nov 28, 2018

Opened airspeed-velocity/asv#775 for anyone interested in the asv on Windows issue I referenced

Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
* PERF: add asv benchmarks for uncovered plotting methods

* PERF: add asv benchmark for DataFrame.rename()

* PERF: add asv benchmarks for .dot()

* PERF: add asv benchmarks for uncovered string methods

* PERF: add asv benchmarks for .expanding() and .ewm()

* PERF: add asv benchmarks for .corr() and .cov()

* PERF: add asv benchmarks for TimedeltaIndex

* PERF: add asv benchmarks for cut()/qcut()
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
* PERF: add asv benchmarks for uncovered plotting methods

* PERF: add asv benchmark for DataFrame.rename()

* PERF: add asv benchmarks for .dot()

* PERF: add asv benchmarks for uncovered string methods

* PERF: add asv benchmarks for .expanding() and .ewm()

* PERF: add asv benchmarks for .corr() and .cov()

* PERF: add asv benchmarks for TimedeltaIndex

* PERF: add asv benchmarks for cut()/qcut()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Benchmark Performance (ASV) benchmarks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants