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

PERF: Check identity first before comparing the objects #42160

Merged
merged 2 commits into from
Jun 21, 2021

Conversation

realead
Copy link
Contributor

@realead realead commented Jun 21, 2021

  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them

This is a regeression in #41952. Checking the identity first avoids long comparison of e.g. tuples - checking the id first is also how PyObject_RichCompareBool(a, b, Py_EQ) works.

Here are results from asv:

       before           after         ratio
     [1ff6970c]       [b8285515]
-      11.0±0.1ms      7.09±0.06ms     0.64  algos.isin.IsInWithLongTupples.time_isin

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
PERFORMANCE INCREASED.

@jreback jreback added the Performance Memory or execution speed performance label Jun 21, 2021
@jreback jreback added this to the 1.3 milestone Jun 21, 2021
@jreback
Copy link
Contributor

jreback commented Jun 21, 2021

great, ping on green.

@jreback jreback merged commit 8d58f0a into pandas-dev:master Jun 21, 2021
@jreback
Copy link
Contributor

jreback commented Jun 21, 2021

thanks @realead

@jreback
Copy link
Contributor

jreback commented Jun 21, 2021

@meeseeksdev backport 1.3.x

@lumberbot-app
Copy link

lumberbot-app bot commented Jun 21, 2021

Something went wrong ... Please have a look at my logs.

simonjayhawkins pushed a commit that referenced this pull request Jun 21, 2021
…bjects (#42163)

Co-authored-by: realead <egor.dranischnikow@googlemail.com>
neinkeinkaffee pushed a commit to neinkeinkaffee/pandas that referenced this pull request Jun 21, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants