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

golang filter: change register configFactory to filterFactory #32183

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

doujiang24
Copy link
Member

We followed the C++ style to register configFactory, but it's not a proper choice for Golang filter.
Here is the Reasons:

  1. Golang introduced the ConfigParser interface to Parse/validate a config, configFactory does not need to parse config.
  2. better performance. By using fiterFactory, we could ommit generate a closure per http request, that may take ~1ns.

Yep, this is a breaking change, people need to change the register API.
So, I suggest we fix it earlier.

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: doujiang24 <[email protected]>
@doujiang24
Copy link
Member Author

Thanks @spacewander , all comments addressed~

Copy link
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

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

rubber stamp approval

@alyssawilk alyssawilk merged commit 83f3f0d into envoyproxy:main Feb 5, 2024
53 checks passed
@doujiang24 doujiang24 deleted the config-factory branch February 6, 2024 01:08
spacewander pushed a commit to mosn/envoy that referenced this pull request Jun 27, 2024
…roxy#32183)

We followed the C++ style to register configFactory, but it's not a proper choice for Golang filter.
Here is the Reasons:

Golang introduced the ConfigParser interface to Parse/validate a config, configFactory does not need to parse config.
better performance. By using fiterFactory, we could ommit generate a closure per http request, that may take ~1ns.
Yep, this is a breaking change, people need to change the register API.
So, I suggest we fix it earlier.
Signed-off-by: doujiang24 <[email protected]>
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.

3 participants