Repository navigation
Conversation
Signed-off-by: wbpcode <wbphub@gmail.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the filter-chain allocation optimization.
No open issues 🎉
What changed in this PR
This PR reduces filter-chain allocation overhead in the Dubbo, Thrift, and SIP network proxies by replacing linked lists with inline-capacity vectors while preserving filter execution order.
Changes:
- Store filter wrappers in
absl::InlinedVector<..., 4>and use recorded indices to resume iteration. - Iterate Thrift encoder filters in reverse to preserve their existing execution order.
- Add build dependencies and update the SIP test to register filters through
addDecoderFilter().
| File | Description |
|---|---|
| source/extensions/filters/network/thrift_proxy/conn_manager.h | Introduces vector-backed chains and wrapper indices. |
| source/extensions/filters/network/thrift_proxy/conn_manager.cc | Implements indexed traversal, reversing encoder order. |
| source/extensions/filters/network/thrift_proxy/BUILD | Adds the inline-vector dependency. |
| source/extensions/filters/network/dubbo_proxy/BUILD | Adds the inline-vector dependency. |
| source/extensions/filters/network/dubbo_proxy/active_message.h | Defines vector-backed chains and index-based continuation interfaces. |
| source/extensions/filters/network/dubbo_proxy/active_message.cc | Registers and resumes filters using vector indices. |
| contrib/sip_proxy/filters/network/test/conn_manager_test.cc | Uses transaction-owned filters in the continuation test. |
| contrib/sip_proxy/filters/network/source/conn_manager.h | Introduces vector-backed decoder chains and wrapper indices. |
| contrib/sip_proxy/filters/network/source/conn_manager.cc | Resumes decoder traversal by index. |
| contrib/sip_proxy/filters/network/source/BUILD | Adds the inline-vector dependency. |
Review effort: Balanced
wbpcode
marked this pull request as draft
November 4, 2026 14:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message: dubbo/thrift/sip: store filter chains in vectors instead of lists
Additional Description:
The dubbo, thrift and sip filter chains used
std::listplusLinkedObjectso that each filter wrapper could keep an iterator to resume iteration from. The chains are built once per message/RPC/transaction and are never modified afterwards, so a list is not needed.This stores the chains in
absl::InlinedVector<..., 4>and has each wrapper record its index when it is added; resuming after a filter starts fromindex + 1. This removes the per-filter list node allocation and, for typical chains, the container allocation entirely. Encoder filters that were pushed to the front of the list are now appended and iterated in reverse, so execution order is unchanged.The sip conn_manager test that built its own separate filter list now adds the filters to the transaction through
addDecoderFilter().Risk Level: Low
Testing: Existing unit tests.
Docs Changes: N/A
Release Notes: N/A