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

[TT-13607] Only import components/io and components/kafka #6720

Conversation

buraksezer
Copy link
Contributor

@buraksezer buraksezer commented Nov 20, 2024

User description

Attempt to fix 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.


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 📝

Relevant files
Enhancement
stream.go
Optimize component imports to reduce memory usage               

ee/middleware/streams/stream.go

  • Removed import of all components.
  • Added specific imports for components/io and components/kafka.
  • +2/-1     
    Dependencies
    go.sum
    Clean up and update Go module dependencies                             

    go.sum

  • Removed multiple unused module dependencies.
  • Updated dependency checksums.
  • +1/-1094

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    @buger
    Copy link
    Member

    buger commented Nov 20, 2024

    💔 The detected issue is not in one of the allowed statuses 💔

    Detected Status Open
    Allowed Statuses In Dev,In Code Review,Ready for Testing,In Test,In Progress,In Review ✔️

    Please ensure your jira story is in one of the allowed statuses

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Import Specificity
    The PR replaces a broad import with specific component imports. Ensure that no other components from the previously imported package are required elsewhere in the application to avoid runtime issues.

    Copy link
    Contributor

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    Copy link
    Contributor

    API Changes

    no api changes detected

    @buraksezer buraksezer enabled auto-merge (squash) November 20, 2024 15:49
    Copy link

    Quality Gate Failed Quality Gate failed

    Failed conditions
    0.0% Coverage on New Code (required ≥ 80%)

    See analysis details on SonarQube Cloud

    @buraksezer buraksezer merged commit 72dd619 into master Nov 20, 2024
    38 of 40 checks passed
    @buraksezer buraksezer deleted the fix/TT-13607/Dashboard-Higher-memory-usage-on-cold-start-in-5.7.0 branch November 20, 2024 16:16
    @buraksezer
    Copy link
    Contributor Author

    /release to release-5.7

    Copy link

    tykbot bot commented Nov 20, 2024

    Working on it! Note that it can take a few minutes.

    @buraksezer
    Copy link
    Contributor Author

    /release to release-5.7.0

    tykbot bot pushed a commit that referenced this pull request Nov 20, 2024
    ### **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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; </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>&nbsp;
    &nbsp; &nbsp; </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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </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
    
    (cherry picked from commit 72dd619)
    Copy link

    tykbot bot commented Nov 20, 2024

    @buraksezer Seems like there is conflict and it require manual merge.

    Copy link

    tykbot bot commented Nov 20, 2024

    Working on it! Note that it can take a few minutes.

    tykbot bot pushed a commit that referenced this pull request Nov 20, 2024
    ### **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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; </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>&nbsp;
    &nbsp; &nbsp; </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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </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
    
    (cherry picked from commit 72dd619)
    Copy link

    tykbot bot commented Nov 20, 2024

    @buraksezer Seems like there is conflict and it require manual merge.

    buraksezer added a commit that referenced this pull request Nov 20, 2024
    …onents/kafka (#6720) (#6721)
    
    ### **User description**
    [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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; </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>&nbsp;
    &nbsp; &nbsp; </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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </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
    
    [TT-13607]:
    https://tyktech.atlassian.net/browse/TT-13607?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
    [TT-13607]:
    https://tyktech.atlassian.net/browse/TT-13607?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
    [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`, `kafka`, and `nats`), reducing memory usage
    on cold start.
    - Cleaned up the `go.mod` 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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; </dd></summary>
    <hr>
    
    ee/middleware/streams/stream.go
    
    <li>Removed import of all components.<br> <li> Added specific imports
    for <code>components/io</code>, <code>components/kafka</code>, and
    <br><code>components/nats</code>.<br>
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6721/files#diff-12571ea9605d5a2dd5ab5aa36972649881f87a84a39b7074213d29d24fc396a8">+3/-1</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr><tr><td><strong>Dependencies</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>go.mod</strong><dd><code>Clean up and update Go module
    dependencies</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
    <hr>
    
    go.mod
    
    <li>Removed numerous unused module dependencies.<br> <li> Updated some
    existing dependencies.<br>
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6721/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+3/-208</a>&nbsp;
    </td>
    
    </tr>
    </table></td></tr><tr><td><strong>Additional files
    (token-limit)</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>go.sum</strong><dd><code>...</code>&nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; </dd></summary>
    <hr>
    
    go.sum
    
    ...
    
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6721/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+10/-1078</a></td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
    request to receive relevant information
    
    Co-authored-by: Burak Sezer <[email protected]>
    buraksezer added a commit that referenced this pull request Nov 20, 2024
    …mponents/kafka (#6720) (#6722)
    
    ### **User description**
    [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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; </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>&nbsp;
    &nbsp; &nbsp; </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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </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
    
    [TT-13607]:
    https://tyktech.atlassian.net/browse/TT-13607?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
    [TT-13607]:
    https://tyktech.atlassian.net/browse/TT-13607?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
    [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`, `kafka`, and `nats`), reducing memory usage
    on cold start.
    - Cleaned up the `go.mod` file by removing unused dependencies and
    updating some dependency versions, 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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; </dd></summary>
    <hr>
    
    ee/middleware/streams/stream.go
    
    <li>Removed import of all components.<br> <li> Added specific imports
    for <code>components/io</code>, <code>components/kafka</code>, and
    <br><code>components/nats</code>.<br>
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6722/files#diff-12571ea9605d5a2dd5ab5aa36972649881f87a84a39b7074213d29d24fc396a8">+3/-1</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr><tr><td><strong>Dependencies</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>go.mod</strong><dd><code>Clean up and update Go module
    dependencies</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
    <hr>
    
    go.mod
    
    <li>Removed multiple unused module dependencies.<br> <li> Updated some
    dependency versions.<br>
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6722/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+3/-208</a>&nbsp;
    </td>
    
    </tr>
    </table></td></tr><tr><td><strong>Additional files
    (token-limit)</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>go.sum</strong><dd><code>...</code>&nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; </dd></summary>
    <hr>
    
    go.sum
    
    ...
    
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6722/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+10/-1078</a></td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
    request to receive relevant information
    
    Co-authored-by: Burak Sezer <[email protected]>
    edsonmichaque pushed a commit that referenced this pull request Feb 14, 2025
    ### **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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; </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>&nbsp;
    &nbsp; &nbsp; </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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </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
    edsonmichaque pushed a commit that referenced this pull request Feb 14, 2025
    ### **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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; </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>&nbsp;
    &nbsp; &nbsp; </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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </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
    edsonmichaque pushed a commit to edsonmichaque/tyk-1 that referenced this pull request Feb 18, 2025
    …ogies#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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; </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>&nbsp;
    &nbsp; &nbsp; </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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </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
    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.

    3 participants