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

Test encoding optimiations #87

Closed
wants to merge 4 commits into from
Closed

Conversation

Gsantomaggio
Copy link
Collaborator

No description provided.

@DanielePalaia
Copy link
Collaborator

HI @qweeze, we are trying to do some general optimization work on the project and we would like also to review the branch you originally posted here: #30

The code is running and it is saving us few seconds over millions of messges but It seems like there an issue importing _FIELD of the dataclasses module. Can you help us going through this? Thanks!

@qweeze
Copy link
Owner

qweeze commented Jul 11, 2023

Hi @DanielePalaia

I re-implemented this optimization with dataclasses in a safer manner here. Didn't benchmark it though, but it shouldn't be much slower than the version using _FIELD. Hope this helps!

@Gsantomaggio
Copy link
Collaborator Author

Thanks @qweeze
I tried the branch and:

(.venv) ➜  rstream git:(feat/encoding-optimizations) python docs/examples/basic_producers/producer_send_batch_binary.py
Sent 1000000 messages in 9.1153 seconds. 109706.0540 messages per second

Master:

(.venv) ➜  rstream git:(master) python docs/examples/basic_producers/producer_send_batch_binary.py
Sent 1000000 messages in 7.7188 seconds. 129553.2735 messages per second

So the current implementation seems to be faster.

@qweeze
Copy link
Owner

qweeze commented Jul 15, 2023

@Gsantomaggio I added some more fixes, and run the same benchmark. It showed ~20% speedup (6.8 vs 5.6 seconds). Can you try it again on updated branch?

@Gsantomaggio
Copy link
Collaborator Author

closed in favour of #100

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.

3 participants