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(client): reuse snpb.SubscribeResponse in RPC handler #719

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

ijsong
Copy link
Member

@ijsong ijsong commented Feb 25, 2024

What this PR does

This pull request optimizes
internal/storagenode/client.(*LogClient).Subscribe. It reuses
snpb.SubscribeResponse to reduce heap allocations. Note that it does not reuse
the byte slice in the snpb.SubscribeResponse. It only reuses the struct
snpb.SubscribeResponse itself.

Copy link

codecov bot commented Feb 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.67%. Comparing base (fbf0c17) to head (890508d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #719      +/-   ##
==========================================
- Coverage   49.73%   49.67%   -0.06%     
==========================================
  Files         235      235              
  Lines       20715    20717       +2     
==========================================
- Hits        10302    10291      -11     
- Misses       9774     9783       +9     
- Partials      639      643       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ijsong ijsong force-pushed the perf_grpc_client_sharedbuffer branch from 889b990 to 01fbf39 Compare February 26, 2024 14:43
@ijsong ijsong force-pushed the perf_reuse_subscriberesponse branch from cc39617 to f59cbe0 Compare February 26, 2024 14:43
@ijsong ijsong force-pushed the perf_grpc_client_sharedbuffer branch from 01fbf39 to c39f3e6 Compare February 28, 2024 00:23
@ijsong ijsong force-pushed the perf_reuse_subscriberesponse branch from f59cbe0 to 4baaff2 Compare February 28, 2024 00:23
@ijsong ijsong force-pushed the perf_grpc_client_sharedbuffer branch from c39f3e6 to d604b6f Compare February 28, 2024 04:23
@ijsong ijsong force-pushed the perf_reuse_subscriberesponse branch from 4baaff2 to cd283ae Compare February 28, 2024 04:23
@ijsong ijsong force-pushed the perf_grpc_client_sharedbuffer branch from d604b6f to 10a0efb Compare February 28, 2024 04:30
@ijsong ijsong force-pushed the perf_reuse_subscriberesponse branch from cd283ae to 0c1d77a Compare February 28, 2024 04:31
@ijsong ijsong marked this pull request as ready for review February 28, 2024 04:32
@ijsong ijsong force-pushed the perf_grpc_client_sharedbuffer branch from 10a0efb to 40506df Compare February 28, 2024 04:48
@ijsong ijsong force-pushed the perf_reuse_subscriberesponse branch from 0c1d77a to 578b928 Compare February 28, 2024 04:49
@ijsong ijsong force-pushed the perf_grpc_client_sharedbuffer branch from 40506df to 8014ece Compare March 5, 2024 07:02
@ijsong ijsong force-pushed the perf_reuse_subscriberesponse branch from 578b928 to 1b8f5a0 Compare March 5, 2024 07:02
@ijsong
Copy link
Member Author

ijsong commented Mar 5, 2024

Merge activity

  • Mar 5, 4:41 AM EST: @ijsong started a stack merge that includes this pull request via Graphite.
  • Mar 5, 4:42 AM EST: Graphite rebased this pull request as part of a merge.
  • Mar 5, 4:50 AM EST: @ijsong merged this pull request with Graphite.

Base automatically changed from perf_grpc_client_sharedbuffer to main March 5, 2024 09:41
This pull request optimizes
`internal/storagenode/client.(*LogClient).Subscribe`. It reuses
`snpb.SubscribeResponse` to reduce heap allocations. Note that it does not reuse
the byte slice in the `snpb.SubscribeResponse`. It only reuses the struct
`snpb.SubscribeResponse` itself.
@ijsong ijsong force-pushed the perf_reuse_subscriberesponse branch from 1b8f5a0 to 890508d Compare March 5, 2024 09:42
@ijsong ijsong merged commit e98ac54 into main Mar 5, 2024
11 checks passed
@ijsong ijsong deleted the perf_reuse_subscriberesponse branch March 5, 2024 09:50
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