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

perf(connector): do not create span for parsing each row #13105

Merged
merged 2 commits into from
Oct 27, 2023

Conversation

BugenZhao
Copy link
Member

@BugenZhao BugenZhao commented Oct 27, 2023

Signed-off-by: Bugen Zhao [email protected]I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

In #13073 and #12959 (comment), we find the performance overhead of constructing row-level tracing span is not acceptable. So we remove that in this PR, and manually pass the row context.


Benchmark shows that there's no cost for happy path, which is expected.

parse_nexmark           time:   [1.2238 ms 1.2273 ms 1.2309 ms]

parse_nexmark_with_tracing
                        time:   [1.2131 ms 1.2166 ms 1.2200 ms]

fix #12959

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@@ -579,14 +583,14 @@ async fn into_chunk_stream<P: ByteStreamSourceParser>(mut parser: P, data_stream
match txn_ctl {
TransactionControl::Begin { id } => {
if let Some(Transaction { id: current_id, .. }) = &current_transaction {
tracing::warn!(parent: &parse_span, current_id, id, "already in transaction");
tracing::warn!(current_id, id, "already in transaction");
Copy link
Member Author

Choose a reason for hiding this comment

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

Transaction is only applicable to CDC source, where split_id and offset is not that useful. So simply omit them here.

Base automatically changed from bz/connector-parser-nexmark-integration-bench to main October 27, 2023 07:44
Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

I verified the perf is good (same as before, and rdkafka doesn't matter neither). So LGTM

image

@BugenZhao BugenZhao force-pushed the bz/do-not-create-span-for-parsing-each-row branch from 7bcf367 to f667892 Compare October 27, 2023 09:38
@BugenZhao BugenZhao marked this pull request as ready for review October 27, 2023 09:38
@BugenZhao BugenZhao enabled auto-merge October 27, 2023 09:39
@BugenZhao BugenZhao added this pull request to the merge queue Oct 27, 2023
@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Merging #13105 (f667892) into main (31d6dc0) will increase coverage by 0.08%.
The diff coverage is 22.22%.

@@            Coverage Diff             @@
##             main   #13105      +/-   ##
==========================================
+ Coverage   68.26%   68.34%   +0.08%     
==========================================
  Files        1498     1498              
  Lines      252574   252584      +10     
==========================================
+ Hits       172411   172621     +210     
+ Misses      80163    79963     -200     
Flag Coverage Δ
rust 68.34% <22.22%> (+0.08%) ⬆️

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

Files Coverage Δ
src/connector/src/source/base.rs 69.36% <ø> (ø)
src/connector/src/parser/mod.rs 47.16% <22.22%> (-0.20%) ⬇️

... and 21 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Merged via the queue into main with commit a6f1714 Oct 27, 2023
8 of 9 checks passed
@BugenZhao BugenZhao deleted the bz/do-not-create-span-for-parsing-each-row branch October 27, 2023 10:25
@BugenZhao BugenZhao mentioned this pull request Jun 11, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

perf: kafka source performance regression due to tracing
2 participants