Skip to content

Commit

Permalink
PERF: Increase threashold for using binary search in IndexEngine (#54746
Browse files Browse the repository at this point in the history
)

* Increase threashold for using binary search in IndexEngine

* Add an entry to the latest whatsnew

* Improve entry in the lastest whatsnew

---------

Co-authored-by: Patrick Hoefler <61934744+phofl@users.noreply.github.com>
  • Loading branch information
l3robot and phofl committed Aug 26, 2023
1 parent 9939c32 commit 48f5a96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v2.2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Deprecations

Performance improvements
~~~~~~~~~~~~~~~~~~~~~~~~
-
- Performance improvement when indexing with more than 4 keys (:issue:`54550`)
-

.. ---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/index.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ cdef class IndexEngine:
# map each starget to its position in the index
if (
stargets and
len(stargets) < 5 and
len(stargets) < (n / (2 * n.bit_length())) and
not na_in_stargets and
self.is_monotonic_increasing
):
Expand Down

0 comments on commit 48f5a96

Please sign in to comment.