index._is_multi
State: closed

See timeit stats in #16981.  In cases where we know `index` is some flavor of `pd.Index` object, replacing `isinstance(index, MultiIndex)` with `index._is_multi` cuts the runtime by 40-60%.  And `isinstance(index, ABCMultiIndex)` is about twice as expensive as `isinstance(index, MultiIndex)`.

These checks add up.  Among other things, every call to `DataFrame.__getitem__`  includes a check for `isinstance(self.columns, pd.MultiIndex)`.

 - [ ] closes #xxxx
 - [ ] tests added / passed
 - [ ] passes ``git diff upstream/master -u -- "*.py" | flake8 --diff``
 - [ ] whatsnew entry


Labels:
name: Performance
description: Memory or execution speed performance
name: MultiIndex

Comments:
@jbrockmendel : Nice!  I think you just need a `whatsnew`, and you should be set.
so you can name this ``is_index`` and ``is_multi_index`` if you want

BUT in usage you will have to use

``getattr(obj, 'is_multi_index', None) is not None``

as you can be presented with a Series for example (or an ndarray or whatever)
to be honest, I would like to see the result of asv's on this. I can't believe this actually makes a differnce. ``isinstance`` is highly efficient.
@jreback : They're in #16981, as @jbrockmendel mentioned (see bottom of issue).
All these time differences are in the 100s of nanoseconds. I agree with @jreback that this is unlikely to matter in real code. It is difficult to do anything non-trivial in less than 1 us.
@gfyoung the timings in #16981 are for timeit checks specifically on `isinstance`.  I think @jreback is referring to asv profiling to see if the overall impact of this makes a non-trivial impact on real-life use cases.

I don't have them handy, but when I ran asv on this I saw a handful that were slower for reasons I didn't figure out and a bunch that were much faster.  I don't know how to assess the relative importance of the different asv benchmarks.  I'll run that again and post the results.
@jreback 

> BUT in usage you will have to use
>
>getattr(obj, 'is_multi_index', None) is not None

In the PR I only changed the checks to `_is_multi` in places where we already know we're looking at an `pd.Index` object.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=h1) Report
> Merging [#17147](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/f2b0bdc9bc4e57e101e306db7555eb7db28172e9?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/17147/graphs/tree.svg?token=eZ4WkYLtcO&width=650&src=pr&height=150)](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #17147      +/-   ##
==========================================
- Coverage   91.03%      91%   -0.03%     
==========================================
  Files         161      161              
  Lines       49405    49416      +11     
==========================================
- Hits        44974    44973       -1     
- Misses       4431     4443      +12
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.78% <100%> (-0.01%)` | :arrow_down: |
| #single | `40.28% <47.36%> (-0.05%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.66% <100%> (-0.1%)` | :arrow_down: |
| [pandas/core/indexing.py](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhpbmcucHk=) | `93.93% <100%> (ø)` | :arrow_up: |
| [pandas/core/reshape/merge.py](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9tZXJnZS5weQ==) | `94.24% <100%> (ø)` | :arrow_up: |
| [pandas/core/panel.py](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcGFuZWwucHk=) | `96.92% <100%> (ø)` | :arrow_up: |
| [pandas/core/reshape/reshape.py](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9yZXNoYXBlLnB5) | `99.28% <100%> (ø)` | :arrow_up: |
| [pandas/core/groupby.py](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS5weQ==) | `92.07% <100%> (ø)` | :arrow_up: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `94.94% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `95.94% <100%> (ø)` | :arrow_up: |
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `82.8% <100%> (ø)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `92.02% <100%> (ø)` | :arrow_up: |
| ... and [5 more](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=footer). Last update [f2b0bdc...2723cff](https://codecov.io/gh/pandas-dev/pandas/pull/17147?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

> this is unlikely to matter in real code

Totally reasonable.  Elsewhere I've advocated smaller namespaces.  It may well be that the gains here aren't worth the extra `Index` attribute.

Pasting asv results from py27 on a fairly beefy Ubuntu desktop:

```
       before           after         ratio
     [f9a552dc]       [c75b2f31]
+     5.55±0.06ms         262±10ms    47.26  indexing.Int64Indexing.time_getitem_lists
+      8.77±0.3ms         72.4±2ms     8.26  binary_ops.TimeseriesTZ.time_timestamp_ops_diff1
+        7.48±2ms        49.7±10ms     6.65  algorithms.Algorithms.time_factorize_float
+          72.9ms            288ms     3.96  packers.JSON.time_write_json_T
+        8.05±2ms         28.4±6ms     3.53  algorithms.Algorithms.time_factorize_int
+          76.9ms            225ms     2.93  packers.JSON.time_write_json
+      2.14±0.09s            5.80s     2.71  gil.NoGilGroupby.time_groups_2
+           2.95s            7.21s     2.45  gil.NoGilGroupby.time_groups_4
+           6.13s            13.6s     2.22  gil.NoGilGroupby.time_groups_8
+          99.1ms            219ms     2.21  packers.JSON.time_write_json_mixed_float_int
+           21.6s            44.6s     2.06  gil.nogil_datetime_fields.time_datetime_field_day
+         102±4ms         184±10ms     1.81  index_object.SetOperations.time_int64_union
+        153±20ms        264±0.7ms     1.72  hdfstore_bench.HDF5.time_write_store_table_wide
+      1.46±0.1ms      2.25±0.05ms     1.54  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('BusinessDay', 1)
+          91.0ms            140ms     1.53  packers.JSON.time_write_json_mixed_delta_int_tstamp
+        269±20μs         408±10μs     1.52  strings.StringEncode.time_encode_decode
+     1.42±0.07ms      2.15±0.05ms     1.51  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('Day', 2)
+      2.35±0.1ms      3.51±0.02ms     1.49  parser_vb.read_csv_dateparsing.time_baseline
+        40.1±2ms           58.6ms     1.46  packers.STATA.time_write_stata_with_validation
+           378ms            544ms     1.44  frame_methods.Dropna.time_dropna_axis0_all
+           1.35s            1.95s     1.44  join_merge.ConcatPanels.time_f_ordered_axis2
+           609ms            854ms     1.40  packers.JSON.time_write_json_lines
+      4.29±0.3ms       6.01±0.2ms     1.40  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('CBMonthEnd', 1)
+         127±1μs          176±7μs     1.39  timeseries.DatetimeIndex.time_unique
+           403ms            557ms     1.38  frame_methods.Dropna.time_count_level_axis0_multi
+           482ms            664ms     1.38  frame_methods.Dropna.time_count_level_axis1_mixed_dtypes_multi
+           1.41s            1.93s     1.37  join_merge.ConcatPanels.time_c_ordered_axis1
+           625ms            857ms     1.37  gil.nogil_take1d_int64.time_nogil_take1d_int64
+        90.2±3ms            123ms     1.36  hdfstore_bench.HDF5.time_read_store_table_wide
+     2.94±0.04ms       3.96±0.3ms     1.35  index_object.Float64.time_boolean_series_indexer
+      21.3±0.7ms         28.6±1ms     1.34  categoricals.Categoricals2.time_value_counts_dropna
+           2.39s            3.19s     1.33  join_merge.MergeCategoricals.time_merge_cat
+           1.55s            2.05s     1.32  join_merge.i8merge.time_i8merge
+           12.2s            16.0s     1.31  join_merge.JoinIndex.time_left_outer_join_index
+          11.2ms           14.7ms     1.31  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('FY5253Quarter_1', 1)
+        432±20ms         562±30ms     1.30  timeseries.SemiMonthOffset.time_begin_incr_rng
+           3.82s            4.96s     1.30  join_merge.MergeCategoricals.time_merge_object
+        331±10ms         427±30ms     1.29  inference.to_numeric_downcast.time_downcast('string-nint', 'integer')
+      8.76±0.5μs         11.3±1μs     1.29  period.period_standard_indexing.time_shallow_copy
+        482±20μs         620±30μs     1.29  frame_methods.FrameIsnull.time_isnull
+      20.2±0.4ms         25.9±2ms     1.28  join_merge.MergeAsof.time_by_int
+     3.63±0.08ms       4.65±0.3ms     1.28  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('CBMonthBegin', 1)
+           117ms            150ms     1.28  packers.JSON.time_write_json_date_index
+          61.5ms           78.5ms     1.28  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('FY5253Quarter_2', 2)
+        260±10ms         331±20ms     1.28  inference.to_numeric_downcast.time_downcast('string-int', None)
+           423ms            540ms     1.28  frame_methods.Dropna.time_count_level_axis1_multi
+     2.67±0.06ms       3.39±0.1ms     1.27  stat_ops.stat_ops_level_frame_sum.time_stat_ops_level_frame_sum
+      17.1±0.6ms         21.6±2ms     1.27  groupby.GroupBySuite.time_rank('int', 100)
+          43.7ms           55.3ms     1.26  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('FY5253Quarter_2', 1)
+           1.44s            1.82s     1.26  packers.SQL.time_write_sql
+        460±20μs          574±9μs     1.25  indexing.DataFrameIndexing.time_boolean_rows_object
+           1.37s            1.70s     1.24  join_merge.ConcatPanels.time_c_ordered_axis0
+      2.94±0.2ms      3.64±0.02ms     1.24  groupby.GroupBySuite.time_tail('int', 10000)
+           381ms            471ms     1.24  frame_methods.Dropna.time_dropna_axis1_any_mixed_dtypes
+      3.03±0.1ms      3.74±0.07ms     1.23  rolling.SeriesRolling.time_rolling_quantile_0
+      8.10±0.3ms       9.96±0.1ms     1.23  groupby.groupby_size.time_groupby_size
+         164±9ms          202±8ms     1.23  inference.to_numeric_downcast.time_downcast('string-float', 'float')
+           35.7s            43.7s     1.23  panel_methods.PanelMethods.time_pct_change_items
+      8.70±0.3ms       10.6±0.5ms     1.22  groupby.groupby_nunique.time_groupby_nunique
+     2.97±0.03ms       3.58±0.2ms     1.21  index_object.Float64.time_boolean_indexer
+           1.59s            1.91s     1.20  join_merge.ConcatPanels.time_f_ordered_axis0
+      22.7±0.6μs         27.2±1μs     1.20  timeseries.Offsets.time_timeseries_day_incr
+           2.32s            2.78s     1.20  rolling.DataframeRolling.time_rolling_corr
+      11.4±0.9ms       13.5±0.4ms     1.18  groupby.groupby_multi.time_groupby_multi_series_op
+           1.53s            1.79s     1.17  join_merge.ConcatPanels.time_f_ordered_axis1
+         322±5ms         375±10ms     1.16  frame_methods.Reindex.time_reindex_both_axes
+      29.8±0.6μs       34.4±0.3μs     1.16  algorithms.Algorithms.time_duplicated_int_unique
+     5.87±0.03ms       6.77±0.1ms     1.15  timeseries.DatetimeIndex.time_infer_freq_daily
+      34.5±0.6ms         39.7±1ms     1.15  packers.STATA.time_write_stata
+          79.0μs           90.4μs     1.14  panel_methods.PanelMethods.time_shift_minor
+      13.3±0.5ms       15.2±0.3ms     1.14  timeseries.DatetimeIndex.time_infer_freq_none
+      3.49±0.1μs      3.96±0.06μs     1.13  index_object.Float64.time_slice_indexer_basic
+           1.81s            2.04s     1.13  timeseries.Iteration.time_iter_periodindex
+           1.28s            1.44s     1.13  frame_methods.Reindex.time_reindex_axis1
+           30.1s            33.8s     1.12  panel_methods.PanelMethods.time_pct_change_minor
+           30.4s            34.0s     1.12  panel_methods.PanelMethods.time_pct_change_major
+           9.15s            10.2s     1.11  groupby.GroupBySuite.time_mad('float', 10000)
+      37.7±0.7ms       41.9±0.9ms     1.11  frame_methods.Iteration.time_itertuples
+        682±20μs         755±30μs     1.11  groupby.GroupBySuite.time_tail('float', 100)
-         536±4ms          481±2ms     0.90  timeseries.DatetimeIndex.time_add_offset_slow
-          17.3ms           15.5ms     0.90  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('FY5253Quarter_1', 2)
-           3.11s            2.78s     0.89  groupby.GroupBySuite.time_skew('float', 10000)
-        542±20ms         480±20ms     0.89  timeseries.SemiMonthOffset.time_begin_decr_rng
-          1.43ms           1.26ms     0.88  series_methods.series_isin_int64.time_series_isin_int64
-     5.22±0.03μs       4.58±0.2μs     0.88  indexing.MultiIndexing.time_multiindex_med_get_loc
-     1.22±0.03ms      1.06±0.01ms     0.87  frame_methods.Interpolate.time_interpolate_some_good
-        596±40ms         512±10ms     0.86  packers.CSV.time_write_csv
-           974ms            834ms     0.86  frame_methods.Dropna.time_dropna_axis1_all_mixed_dtypes
-           449ms            383ms     0.85  frame_methods.Dropna.time_dropna_axis0_any_mixed_dtypes
-        688±30μs         583±30μs     0.85  groupby.GroupBySuite.time_cumprod('float', 100)
-     9.55±0.09ms       8.00±0.2ms     0.84  io_sql.ReadSQLTypes.time_float_read_query_sqlalchemy
-     7.59±0.03ms           6.35ms     0.84  timeseries.DatetimeIndex.time_dti_tz_factorize
-        772±30μs         636±10μs     0.82  groupby.GroupBySuite.time_value_counts('int', 100)
-      13.6±0.1ms       11.1±0.1ms     0.81  eval.Query.time_query_datetime_index
-         876±3ms        712±0.8ms     0.81  reshape.reshape_unstack_large_single_dtype.time_unstack_full_product
-      2.22±0.1ms      1.78±0.09ms     0.80  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('QuarterEnd', 1)
-        312±10ms          246±8ms     0.79  reshape.reshape_pivot_time_series.time_reshape_pivot_time_series
-        325±30ms          255±8ms     0.79  join_merge.Align.time_series_align_left_monotonic
-      17.4±0.1ms       13.6±0.5ms     0.78  join_merge.Join.time_join_dataframe_index_single_key_bigger_sort
-      16.6±0.4ms           12.9ms     0.78  frame_methods.Iteration.time_iteritems_indexing
-      5.06±0.1μs      3.94±0.06μs     0.78  index_object.Float64.time_slice_indexer_even
-      2.91±0.2ms      2.23±0.08ms     0.76  groupby.GroupBySuite.time_cumprod('int', 10000)
-           525ms            393ms     0.75  frame_methods.Dropna.time_dropna_axis1_all
-     1.22±0.02ms         912±20μs     0.74  categoricals.Categoricals2.time_rendering
-          10.9μs       7.97±0.2μs     0.73  timeseries.DatetimeIndex.time_timestamp_tzinfo_cons
-        58.7±5ms           42.4ms     0.72  packers.packers_read_stata_with_validation.time_packers_read_stata_with_validation
-         282±9ms          196±4ms     0.70  indexing.Int64Indexing.time_loc_scalar
-        21.9±2ms       15.0±0.3ms     0.68  timeseries.AsOfDataFrame.time_asof_single
-          13.5ms       9.18±0.4ms     0.68  timeseries.DatetimeIndex.time_add_offset_fast
-        500±70ms         337±10ms     0.67  join_merge.Align.time_series_align_int64_index
-      4.61±0.2ms      3.10±0.04ms     0.67  hdfstore_bench.HDF5.time_store_info
-        17.8±2ms       11.6±0.3ms     0.65  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('FY5253_2', 1)
-        769±30μs         491±40μs     0.64  reindex.FillMethod.time_pad_daterange
-      2.49±0.3ms      1.59±0.05ms     0.64  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('BQuarterEnd', 2)
-     2.40±0.09ms       1.51±0.1ms     0.63  frame_ctor.FrameConstructorDTIndexFromOffsets.time_frame_ctor('MonthEnd', 1)
-        819±30ms         515±10ms     0.63  timeseries.ToDatetime.time_format_no_exact
-           3.11s            1.95s     0.62  groupby.Groups.time_groupby_groups('object_large')
-          3.58ms      2.19±0.03ms     0.61  timeseries.DatetimeIndex.time_timeseries_is_month_start
-       592±200ms            318ms     0.54  gil.NoGilGroupby.time_sum_8_notp
-           315ms            163ms     0.52  packers.JSON.time_write_json_mixed_float_int_T
-         703±8ms         358±20ms     0.51  packers.Packers.time_packers_read_csv
-           3.69s            1.75s     0.48  groupby.Groups.time_groupby_groups('object_small')
-           1.74s         648±60ms     0.37  timeseries.AsOfDataFrame.time_asof
-           418ms          108±2ms     0.26  series_methods.series_isin_int64.time_series_isin_int64_large
-           2.12s         546±60ms     0.26  timeseries.AsOfDataFrame.time_asof_nan
-           406ms           82.8ms     0.20  packers.JSON.time_write_json_mixed_float_int_str
-           4.84s            932ms     0.19  groupby.Groups.time_groupby_groups('int64_large')
-           3.73s            676ms     0.18  groupby.Groups.time_groupby_groups('int64_small')
```

Re-running that sketchy looking first one, I'm getting ratios ranging between 0.69 and 95.39.   Re-running the last `groupby.Groups.time_groupby_groups` that look especially good here, the ratios are clumping close to .85, occasionally peeking above 1 or back down to .19.  

@jreback for future reference, how reliable are these? Which of these should I be paying the most attention to?

@jbrockmendel you should NOT have wildly varying results. generally when running the asvs you can't be doing anything else on the machine. So pick a subset of the benches and run them a couple of times.

Also you should pick a specific one that hits this code path and simply run time-it before and after.
> you can't be doing anything else on the machine

There's a limit to how closely I can follow this instruction.  I'll see what I can do.

> [...] simply run time-it before and after.

I don't follow.  Are you referring to `timeit.timeit`?  Or prefixing the "asv continuous..." with "time asv continuous..."?  I'm going off the instructions [here](http://pandas.pydata.org/pandas-docs/stable/contributing.html).
I think what Jeff meant was to pick one actual example (so user like example, not just a bench of the isinstance, which can come from the asv suite, but can also be a simple example you make up yourself) that actually hits some of those checks you changed, and then run this example a few time with `%timeit` to see if the changes actually make a difference.

Often that is easier to just have an idea while developing, than running the full asv suite (as this takes some time (you can pick a few benches of course) and there is always some variation on it, although it should not be that large as you posted)

TLDR: the gains here are mixed and likely not worth pursuing.  I don't remotely understand why this would hurt performance in any case and would be very interested if someone can explain it to me.

I wrapped each of the benchmarks from asv_bench/benchmarks/indexing.py inside `timeit.timeit` with `number=10000`.  Ran the old and new versions concurrently to keep system-load fixed.
```
                                                          old          new     ratio
MultiIndexing.time_multiindex_string_get_loc         0.072173     0.042667  0.591180
Int64Indexing.time_loc_scalar                        0.514279     0.304450  0.591994
DataFrameIndexing.time_get_value_ix                  0.070953     0.047430  0.668467
IntervalIndexing.time_loc_scalar                     0.731382     0.557354  0.762056
DatetimeIndexing.time_getitem_scalar                 0.046275     0.037064  0.800954
Int64Indexing.time_loc_list_like                     4.385614     3.564660  0.812808
MultiIndexing.time_multiindex_med_get_loc            0.077026     0.063410  0.823228
MultiIndexing.time_multiindex_med_get_loc_warm      62.657994    52.155032  0.832376
MultiIndexing.time_frame_xs_mi_ix                    3.763521     3.230838  0.858462
DataFrameIndexing.time_loc_dups                     13.048171    11.236136  0.861127
Int64Indexing.time_getitem_list_like                 2.817089     2.465141  0.875067
Int64Indexing.time_iloc_list_like                    0.434559     0.386217  0.888757
Int64Indexing.time_iloc_scalar                       0.119464     0.108139  0.905201
MultiIndexing.time_series_xs_mi_ix                   3.180289     2.880627  0.905775
IntervalIndexing.time_getitem_list                   1.112638     1.012087  0.909628
DataFrameIndexing.time_iloc_big                      1.304308     1.197525  0.918131
Int64Indexing.time_iloc_slice                        0.360181     0.332867  0.924167
DataFrameIndexing.time_getitem_scalar                0.110882     0.103850  0.936582
MultiIndexing.time_remove_unused_levels              6.148088     5.769872  0.938482
DataFrameIndexing.time_boolean_rows                  3.610850     3.394835  0.940176
IntervalIndexing.time_loc_list                       0.979348     0.924186  0.943675
StringIndexing.time_get_value                        0.369665     0.348958  0.943985
DataFrameIndexing.time_iloc_dups                     2.282086     2.217480  0.971690
MultiIndexing.time_multiindex_small_get_loc_warm    52.976377    51.634706  0.974674
Int64Indexing.time_getitem_lists                    27.316124    26.705702  0.977653
StringIndexing.time_getitem_label_slice              0.764872     0.755151  0.987291
PanelIndexing.time_subset                           10.480220    10.366738  0.989172
DataFrameIndexing.time_boolean_rows_object           5.262628     5.264051  1.000270
MultiIndexing.time_multiindex_large_get_loc_warm  2096.727909  2118.089428  1.010188
DataFrameIndexing.time_get_value                     0.017628     0.017869  1.013674
Int64Indexing.time_getitem_array                     5.552607     5.634688  1.014782
Int64Indexing.time_loc_slice                         0.650662     0.664971  1.021992
MultiIndexing.time_is_monotonic                      0.196724     0.204743  1.040761
MultiIndexing.time_multiindex_slicers               61.789704    66.649427  1.078649
IntervalIndexing.time_getitem_scalar                 0.399074     0.448703  1.124360
Int64Indexing.time_iloc_array                        1.047691     1.180230  1.126506
Int64Indexing.time_ix_slice                          0.633261     0.721188  1.138848
MultiIndexing.time_multiindex_large_get_loc          2.135768     2.458250  1.150991
MultiIndexing.time_multiindex_get_indexer           12.741345    14.698841  1.153633
Int64Indexing.time_getitem_slice                     0.696352     0.820771  1.178673
Int64Indexing.time_ix_array                          6.770135     8.028476  1.185866
Int64Indexing.time_loc_array                         9.285649    11.144338  1.200168
Int64Indexing.time_ix_list_like                      2.806115     3.392442  1.208946
StringIndexing.time_getitem_pos_slice                0.581314     0.764687  1.315446
Int64Indexing.time_ix_scalar                         0.363763     0.486264  1.336760
Int64Indexing.time_getitem_scalar                    0.156561     0.270340  1.726740
```
That seems indeed a to large difference to be caused by this PR. Just to check this, I would advise to pick one of the functions above, and run it a few times with `%timeit` (which already repeats a few times `timeit.timeit` by itself and reports average numbers and std. If you don't want to use IPython's magic, you can also manually use timeit.Timer.repeat or do a double repeat of timeit.timeit ) for both master and this PR, and look at the variability between the runs and between master and PR. That way, I think you will get a better idea of the timings.
@jbrockmendel and I am referring to ipython magic, simply use ``%timeit``. as @jorisvandenbossche says, pick a case or 2 from above and profile / time and see.
closing as this would need performance validation