Skip to content

Conversation

@Orvaxis
Copy link
Contributor

@Orvaxis Orvaxis commented Oct 8, 2025

While Tokio's locks should generally be avoided, a Mutex is used here at the entry point for incoming packets, solely for the purpose of stream removal. This could potentially become a bottleneck under high throughput, though it doesn't seem to be an issue at present.

@SajjadPourali SajjadPourali requested a review from Copilot October 8, 2025 06:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes packet processing performance by removing the tokio::sync::Mutex from the session collection entry point and replacing it with a channel-based approach for session removal. This change eliminates potential contention at the critical path of incoming packet processing.

  • Replaced Arc<Mutex<AHashMap>> with plain AHashMap for session storage
  • Introduced unbounded channel for asynchronous session removal notifications
  • Modified function signatures to use references instead of clones where possible

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@SajjadPourali SajjadPourali requested a review from Copilot October 9, 2025 04:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@SajjadPourali SajjadPourali requested a review from Copilot October 9, 2025 04:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ssrlive ssrlive merged commit 22ae9dc into narrowlink:main Oct 10, 2025
2 checks passed
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