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: reduce timer in write_control #879

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

rfyiamcool
Copy link
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Go Version Update
  • Dependency Update

Description

In most cases, we do not write concurrently to the same client, and the gorilla library limits the concurrency, when gorilla detect write data concurrently, throw panic ? In the addition, creating and stopping a timer is not a simple action. 😁

So, we can get the lock first and if we can't get it, we can create a timer. 😁

Run verifications and test

  • make verify is passing
  • make test is passing

@jaitaiwan jaitaiwan self-assigned this Jan 17, 2024
Copy link

@ethanwater ethanwater left a comment

Choose a reason for hiding this comment

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

I like this!

AlexVulaj
AlexVulaj previously approved these changes Jan 22, 2024
Copy link
Member

@AlexVulaj AlexVulaj left a comment

Choose a reason for hiding this comment

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

Thanks for this update!

@AlexVulaj AlexVulaj force-pushed the perf/write_control_reduce_timer branch from 5346582 to 65e092b Compare January 22, 2024 04:29
Copy link

codecov bot commented Jan 22, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (cf50a3e) 71.21% compared to head (82e2b1a) 71.26%.

Files Patch % Lines
conn.go 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #879      +/-   ##
==========================================
+ Coverage   71.21%   71.26%   +0.05%     
==========================================
  Files          11       11              
  Lines        1584     1587       +3     
==========================================
+ Hits         1128     1131       +3     
  Misses        349      349              
  Partials      107      107              

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

@AlexVulaj
Copy link
Member

@rfyiamcool Before merging - would you mind adding/updating tests for this change?

Signed-off-by: rfyiamcool <rfyiamcool@163.com>
Signed-off-by: rfyiamcool <rfyiamcool@163.com>
@rfyiamcool rfyiamcool force-pushed the perf/write_control_reduce_timer branch from fb2b82c to 82e2b1a Compare January 22, 2024 05:51
@rfyiamcool
Copy link
Contributor Author

@rfyiamcool Before merging - would you mind adding/updating tests for this change?

done, the ut is ok ? 😁

@AlexVulaj AlexVulaj merged commit d08ee1a into gorilla:main Jan 23, 2024
11 of 12 checks passed
@canelohill canelohill mentioned this pull request Jun 23, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants