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

Produce request encoding performance improvement #69

Conversation

zmstone
Copy link
Contributor

@zmstone zmstone commented Feb 29, 2020

produce request encoding is the most critical code path.
judging by the naive bechmark (light version added as a eunit test),
the time cost to complete the eunit case is improved by about 35%

changelog.md Outdated Show resolved Hide resolved
@zmstone zmstone force-pushed the produce-request-encoding-performance-improvement-backup branch 2 times, most recently from f1d6859 to a730987 Compare March 1, 2020 10:56
@zmstone zmstone changed the title Produce request encoding performance improvement backup Produce request encoding performance improvement Mar 21, 2020
@zmstone zmstone force-pushed the produce-request-encoding-performance-improvement-backup branch from a730987 to 63a46b7 Compare March 21, 2020 12:40
@zmstone
Copy link
Contributor Author

zmstone commented Mar 21, 2020

@k32 possible to merge this one ?

@zmstone
Copy link
Contributor Author

zmstone commented Mar 21, 2020

sorry. hold on.

@zmstone
Copy link
Contributor Author

zmstone commented Mar 21, 2020

now @k32 please take a look again.

zmstone added 5 commits March 21, 2020 17:13
Aslo added a simle eunit test to benchmark
produce request encoding before/after performance
this patch speeds up encoding around 35%
The naive idea was to ensure binary so nif should not need to
copy iolist as binary (it would take the already carated binary directly)
@zmstone zmstone force-pushed the produce-request-encoding-performance-improvement-backup branch from 6dd5d3f to 03396e6 Compare March 21, 2020 16:14
@k32
Copy link

k32 commented Mar 23, 2020

Thank you!

@k32 k32 merged commit 6a8ce6a into kafka4beam:master Mar 23, 2020
@zmstone zmstone deleted the produce-request-encoding-performance-improvement-backup branch March 23, 2020 12:40
turtleDeng pushed a commit to emqx/kafka_protocol that referenced this pull request Jan 11, 2021
* Produce request encoding performance improvement (kafka4beam#69)

* Improve produce request encoding performance

Also added a simple eunit test to benchmark
produce request encoding before/after performance
this patch speeds up encoding around 35%

* Allow #kpro_msg.msg to be iodata()

* Delete remote call to iolist_size

* No need to make binary for enif_inspect_iolist_as_binary

The naive idea was to ensure binary so nif should not need to
copy iolist as binary (it would take the already created binary directly)

* Avoid iolist_to_binary when encoding string

* Upgrade snappyer and crc32cer deps to support windows (kafka4beam#73)

* fix(connection): back pressure for send API even when no_ack

* chore(appup): pin version 2.3.6.1 and add appup
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