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] Lazy encode connectors in persister #1249

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

lovromazgon
Copy link
Member

Description

With this change the connector persister lazily encodes connectors only when they are flushed. The connector data is still copied at the time the connector requests to be persisted. This is currently required because of the locking mechanism (see #857 for more info), there is still room for improvement here as most copies will be thrown away, especially on fast pipelines.

This also changes the library used for encoding to github.com/goccy/go-json, which is quite a lot faster.

Quick checks:

  • I have followed the Code Guidelines.
  • There is no other pull request for the same update/change.
  • I have written unit tests. (existing tests)
  • I have made sure that the PR is of reasonable size and can be easily reviewed.

@lovromazgon lovromazgon requested a review from a team as a code owner October 20, 2023 19:17
Copy link
Contributor

@nassor nassor left a comment

Choose a reason for hiding this comment

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

I also believe that it is faster but It is missing the benchmarks to support the claims.

@lovromazgon
Copy link
Member Author

I didn't have time at this point to create benchmarks for this, but rest assured, I tested it manually and there was about a 7% increase in throughput 😉

@lovromazgon lovromazgon enabled auto-merge (squash) October 24, 2023 11:28
@lovromazgon lovromazgon merged commit 3145202 into main Oct 24, 2023
3 checks passed
@lovromazgon lovromazgon deleted the lovro/connector-persister-optimization branch October 24, 2023 11:47
@simonl2002 simonl2002 modified the milestones: 0.9.0, 0.8.0 Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants