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

opt filtermanager 'onContinueReading' performance #1933

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alpha-baby
Copy link
Member

Issues associated with this PR

#1932

Solutions

You should show your solutions about the issues in your PR, including the overall solutions, details and the changes. At this time, Chinese is allowed to describe these.

UT result

Unit Test is needed if the code is changed, your unit test should cover boundary cases, corner cases, and some exceptional cases. And you need to show the UT result.

Benchmark

If your code involves the processing of every request, you should give the Benchmark Result.

Code Style

  • Make sure Goimports has run
  • Show Golint result

@@ -64,3 +64,5 @@ require (
)

replace github.com/envoyproxy/go-control-plane => github.com/envoyproxy/go-control-plane v0.9.4

replace mosn.io/api => ../mosn-api
Copy link
Member

Choose a reason for hiding this comment

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

should not push these local changes.


buf := fm.conn.GetReadBuffer()
func (fm *filterManager) onContinueReading(previousIndex int, buf buffer.IoBuffer) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
func (fm *filterManager) onContinueReading(previousIndex int, buf buffer.IoBuffer) {
func (fm *filterManager) onContinueReading(index int, buf buffer.IoBuffer) {

maybe we can just use index here? It looks more simpiler.

//fm.conn.Write("your data")
return
}
for ; index < len(fm.upstreamFilters); index++ {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if it is safe to skip checking uf.initialized here.
@taoyuanyuan @nejisama may confirm it.

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.

None yet

2 participants