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: micro optimizations #6269

Merged
merged 1 commit into from
Feb 6, 2014
Merged

PERF: micro optimizations #6269

merged 1 commit into from
Feb 6, 2014

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Feb 5, 2014

PERF: enhance tseries getitem indexing
PERF: micro optimzations in inference
API/CLN: core.internals.apply now only takes kwargs; makes code a bit simpler
CLN: wrap core/common/isnull into more direct Block.isnull
PERF: fast path series block operations

closes #6264

original timings

In [11]: %timeit com.is_integer(13)
100000 loops, best of 3: 1.29 µs per loop

In [12]: %timeit com.is_integer(np.int32(2))
100000 loops, best of 3: 3.32 µs per loop

In [13]: %timeit com.is_integer(np.int64(2))
100000 loops, best of 3: 1.86 µs per loop

In [14]: %timeit com.is_integer(14L)
100000 loops, best of 3: 1.29 µs per loop

In [15]: %timeit com.is_integer("1")
100000 loops, best of 3: 2.2 µs per loop

with this PR

In [2]: %timeit com.is_integer(13)
10000000 loops, best of 3: 72.5 ns per loop

In [3]: %timeit com.is_integer(np.int32(2))
1000000 loops, best of 3: 620 ns per loop

In [4]: %timeit com.is_integer(np.int64(2))
1000000 loops, best of 3: 315 ns per loop

In [5]: %timeit com.is_integer(14L)
10000000 loops, best of 3: 72.4 ns per loop

In [6]: %timeit com.is_integer("1")
10000000 loops, best of 3: 78.8 ns per loop

@jreback
Copy link
Contributor Author

jreback commented Feb 5, 2014

@y-p side issue when you have a chance

for some reason the cython caching is too aggressive here

https://travis-ci.org/jreback/pandas/jobs/18271060

this is a new branch with a cherry-picked commit (as the original branch had the same caching issue)

PERF: micro optimzations in inference

API/CLN: core.internals.apply now only takes kwargs; makes code a bit simpler

CLN: wrap core/common/isnull into more direct Block.isnull

PERF: fast path series block operations
jreback added a commit that referenced this pull request Feb 6, 2014
PERF: micro optimizations
@jreback jreback merged commit cc6ee40 into pandas-dev:master Feb 6, 2014
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.

com.is_integer is slow
4 participants