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] Inspector refactoring and optimization #1248

Merged
merged 4 commits into from
Oct 24, 2023

Conversation

lovromazgon
Copy link
Member

Description

The inspector was allocating quite a lot of data even if no sessions were open. Now it's optimized for the hot path when there are no open sessions.

goos: darwin
goarch: amd64
pkg: github.com/conduitio/conduit/pkg/inspector
cpu: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
                                │  bench.old  │              bench.new               │
                                │   sec/op    │    sec/op     vs base                │
Inspector_NoSession_Send-16       31.96n ± 2%    14.70n ± 1%  -54.01% (p=0.000 n=10)
Inspector_SingleSession_Send-16   92.88n ± 1%   122.15n ± 2%  +31.52% (p=0.000 n=10)
Inspector_10Sessions_Send-16      447.6n ± 2%    447.1n ± 2%        ~ (p=0.895 n=10)
geomean                           109.9n         92.94n       -15.46%

Note that the single session benchmark is slower now because of the use of Record.Clone(), although that usage is now correct, since we previously did not clone all fields. Note that cloning of records was sped up in #1247.

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
@lovromazgon lovromazgon merged commit be519c6 into main Oct 24, 2023
3 checks passed
@lovromazgon lovromazgon deleted the lovro/inspector-optimization branch October 24, 2023 13:23
@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