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

Improve send performance (#943) #946

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Conversation

ods
Copy link
Collaborator

@ods ods commented Nov 26, 2023

Changes

Fixes #943

The results of benchmark/simple_produce_bench.py:

  • before: 120101.0 m/s
  • after: 141686.0 m/s

Copy link

codecov bot commented Nov 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b029fa2) 84.27% compared to head (3554731) 84.27%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #946   +/-   ##
=======================================
  Coverage   84.27%   84.27%           
=======================================
  Files          87       87           
  Lines       10039    10040    +1     
=======================================
+ Hits         8460     8461    +1     
  Misses       1579     1579           
Flag Coverage Δ
cext 79.30% <100.00%> (+<0.01%) ⬆️
integration 84.25% <100.00%> (+<0.01%) ⬆️
purepy 84.02% <100.00%> (+0.01%) ⬆️
unit 51.45% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ods ods mentioned this pull request Nov 26, 2023
4 tasks
Copy link

@uchiiii uchiiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! @ods

This LGTM and I measured the performance on the same environment using this modification.
Here is the result.

Running Tests for Kafka-Python
Starting benchmark for Kafka-Python producer.
Kafka-Python producer Results:
Number of Runs: 5, Number of messages: 100000, Message Size: 100 bytes.
Average Time for 100000 messages: 6.893932819366455 seconds.
Messages / sec: 14505.508339025255
MB / sec : 1.3833530749345069
===================
Running Tests for AIOKafka
kafka-client-benchmarks/aiokafka-benchmark.py:40: DeprecationWarning: The loop argument is deprecated since 0.7.1, and scheduled for removal in 0.9.0
  producer = AIOKafkaProducer(loop=loop, **producer_config)
Starting benchmark for AIOKafka Producer.
AIOKafka Producer Results:
Number of Runs: 5, Number of messages: 100000, Message Size: 100 bytes.
Average Time for 100000 messages: 1.3094082355499268 seconds.
Messages / sec: 76370.37654494504
MB / sec : 7.283246664518837
===================

Improved more than #942, so I close #942.

BTW, is it possible to make this fix available some way soon?

@ods ods merged commit 8814e7b into aio-libs:master Nov 27, 2023
29 of 31 checks passed
@ods
Copy link
Collaborator Author

ods commented Nov 27, 2023

BTW, is it possible to make this fix available some way soon?

I'm going to include it into 0.9.0rc1, probably on Wednesday. Then we need some feedback before doing final release, especially from people using snappy and zsdt compression.

@ods
Copy link
Collaborator Author

ods commented Nov 29, 2023

Pre-release with fix is ready, please check

@uchiiii
Copy link

uchiiii commented Nov 30, 2023

Thank you for your work. I confirmed everything worked well!

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.

performance degradation of producer when having many topics
2 participants