Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TT-13607] Only import components/io and components/kafka (#6720)
### **User description** Attempt to fix [TT-13607](https://tyktech.atlassian.net/browse/TT-13607) We should not need to import all components. I also ran `go mod tidy` to reduce the dependency graph. Initial memory usage:: - with two components: io and kafka: 34.5 MB - with all components: 71.2 MB I tested the changes locally with Kafka & labs-streams sample. It works as usual. [TT-13607]: https://tyktech.atlassian.net/browse/TT-13607?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** enhancement, dependencies ___ ### **Description** - Optimized the import statements in `stream.go` to include only necessary components (`io` and `kafka`), reducing memory usage on cold start. - Cleaned up the `go.sum` file by removing unused dependencies, which helps in reducing the dependency graph. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>stream.go</strong><dd><code>Optimize component imports to reduce memory usage</code> </dd></summary> <hr> ee/middleware/streams/stream.go <li>Removed import of all components.<br> <li> Added specific imports for <code>components/io</code> and <code>components/kafka</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6720/files#diff-12571ea9605d5a2dd5ab5aa36972649881f87a84a39b7074213d29d24fc396a8">+2/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Dependencies</strong></td><td><table> <tr> <td> <details> <summary><strong>go.sum</strong><dd><code>Clean up and update Go module dependencies</code> </dd></summary> <hr> go.sum <li>Removed multiple unused module dependencies.<br> <li> Updated dependency checksums.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6720/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+1/-1094</a></td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information
- Loading branch information