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

Some more cython optimizations ? #5

Open
tzickel opened this issue May 3, 2020 · 1 comment
Open

Some more cython optimizations ? #5

tzickel opened this issue May 3, 2020 · 1 comment

Comments

@tzickel
Copy link

tzickel commented May 3, 2020

While working on ChunkedBuffer:

https://github.com/tzickel/chunkedbuffer

I think it's for calling python methods which are already bound to a Python object, it's faster to do instead of (check the annotated output):

self._bufs_popleft(...)

this:

with cython.optimize.unpack_method_calls(False):
    self._bufs_popleft(...)

^^- but it's better to leave it though for calling other stuff, like when calling an .find directly.

Also instead of:

self._bufs = collections.deque()

it's less code

from collections import deque
self._bufs = deque()
@1st1
Copy link
Member

1st1 commented May 4, 2020

I think these are micro-optimizations and it's highly unlikely that they would show a detectable speedup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants