PERF: performance regression in slicing a Series #33323
Labels
Indexing
Related to indexing on series/frames, not to indexes themselves
Performance
Memory or execution speed performance
Regression
Functionality that used to work in a prior pandas version
Milestone
All of the slice indexing benchmarks are showing regressions, eg https://pandas.pydata.org/speed/pandas/#indexing.NumericSeriesIndexing.time_loc_slice?p-index_dtype=%3Cclass%20'pandas.core.indexes.numeric.Int64Index'%3E&p-index_structure='unique_monotonic_inc'&commits=80d37adc-4f89c261
Replicating one of them with a small snippet confirms this:
vs
Checking with snakeviz shows that on master, quasi all time the indexing operation takes is spent in setting the
mgr_locs
(creating the BlockPlacement object), which is certainly not as expected:Putting a breakpoint in the Block init just before creating the BlockPlacement, showed that the value being passed on master is a
range
object, while this should be aslice
object, I assume.Going up the stack to see where this range object is created, points to:
pandas/pandas/core/internals/managers.py
Line 1571 in a9c105a
which according to
git blame
is last touched by this PR: #32421. And indeed, a range object was added there instead of a slice (other places in the PR did use a slice, so this was probably kind of a typo).The text was updated successfully, but these errors were encountered: