Skip to content

PERF: use fastpath=True in Index methods (delete/drop/insert/etc)? #6933

Closed
@immerrr

Description

@immerrr

Been hit by this when optimizing index-oblivious Blocks. In my case,

is_deleted = np.zeros(len(index), dtype=np.bool_)
is_deleted[deleted_loc] = True
index = index[~is_deleted]

was still a lot faster then than index.delete(deleted_loc).

It appears, that delete doesn't add fastpath=True to ctor and that triggers type inference for string (object) indices. There seems to be plenty of methods that do it the same way and hence are slow too, can we do something about that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    IndexingRelated to indexing on series/frames, not to indexes themselvesPerformanceMemory or execution speed performance

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions