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

Pre-compile pack/unpack function calls #1619

Merged
merged 1 commit into from
Oct 29, 2018
Merged

Conversation

jeffwidman
Copy link
Collaborator

@jeffwidman jeffwidman commented Oct 29, 2018

PR that pulls in @billyevans suggested performance improvement from #1555:

I noticed that pack/unpack functions from
https://github.com/dpkp/kafka-python/blob/master/kafka/protocol/types.py
might be slightly improved. I made pre-compilation for them. It gives
about 10% better performance compared to the current implementation.

Consumption of 100msg:

239884    0.187    0.000    0.287    0.000 types.py:18(_unpack) # new version
239884    0.192    0.000    0.323    0.000 types.py:17(_unpack)

I also made some profiling for producers/consumers. It gives about
1-1.5% time savings.


This change is Reviewable

I noticed that pack/unpack functions from
https://github.com/dpkp/kafka-python/blob/master/kafka/protocol/types.py
might be slightly improved. I made pre-compilation for them. It gives
about 10% better performance compared to the current implementation.

Consumption of 100msg:
```
239884    0.187    0.000    0.287    0.000 types.py:18(_unpack) # new version
239884    0.192    0.000    0.323    0.000 types.py:17(_unpack)
```

I also made some profiling for producers/consumers. It gives about
1-1.5% time savings.
@jeffwidman
Copy link
Collaborator Author

@billyevans can you confirm that you're okay with us pulling in this patch? I don't want to merge it without your permission.

@billyevans
Copy link
Contributor

@jeffwidman yes, I am totally fine.

@jeffwidman jeffwidman merged commit 3689da3 into master Oct 29, 2018
@jeffwidman jeffwidman deleted the struct-pre-compilation branch October 29, 2018 19:57
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

Successfully merging this pull request may close these issues.

2 participants