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

Hpack optimizations #7086

Merged
merged 6 commits into from Apr 28, 2023
Merged

Conversation

armanbilge
Copy link
Member

  1. use ByteVector#toInputStream and ByteVectorOuputStream for copy-free conversions
  2. use List.newBuilder instead of ListBuffer (not sure if this makes a difference, but intent is clearer)
  3. use Mutex instead of Sempahore(1) (performance is optimized and communicates intent)

@mergify mergify bot added series/0.23 PRs targeting 0.23.x module:ember-core labels Apr 23, 2023
val decoded = buffer.toList
NonEmptyList.fromList(decoded).toRight(new NoSuchElementException("Header List Was Empty"))
}.rethrow
val decoded = buffer.result()
NonEmptyList.fromListUnsafe(decoded)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, forgot to mention: we can use fromListUnsafe because we are in a delay(...) block anyway, and skip the .rethrow.

Copy link
Member

@danicheg danicheg left a comment

Choose a reason for hiding this comment

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

To be consecutive, I usually ask for some numbers to prove that we get better performance when it comes to some optimizations. But Arman definitely knows what he does (also, changes look good to me)!

@danicheg danicheg merged commit f68aca6 into series/0.23 Apr 28, 2023
17 checks passed
@danicheg danicheg deleted the pr/optimization-use-bytevector-toinputstream branch April 28, 2023 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants