Skip to content

Specialize functions to avoid dynamic dispatch #985

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

Merged
merged 2 commits into from
Jan 7, 2023

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Jan 7, 2023

This helps reduce allocations and make client requests a little more stable with regards to allocations and performance.

This helps reduce allocations and make client requests a little more stable
with regards to allocations and performance.
quinnj added a commit to JuliaWeb/OpenSSL.jl that referenced this pull request Jan 7, 2023
Together with JuliaWeb/HTTP.jl#985, this reduces
allocations on a typical request by about ~100. The main wins here are
hard-coding TCPSocket as the `io` field of `SSLStream` (which we assume
anyway), and changing the `geterror` function to a macro to avoid the
closure boxing problem.
@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2023

Codecov Report

Merging #985 (6c83eee) into master (47c24c9) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #985   +/-   ##
=======================================
  Coverage   82.61%   82.61%           
=======================================
  Files          36       36           
  Lines        3037     3037           
=======================================
  Hits         2509     2509           
  Misses        528      528           
Impacted Files Coverage Δ
src/IOExtras.jl 77.77% <ø> (ø)
src/ConnectionPool.jl 85.65% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

quinnj added a commit to JuliaWeb/OpenSSL.jl that referenced this pull request Jan 7, 2023
* Refactor code a bit to reduce allocations and dynamic dispatches

Together with JuliaWeb/HTTP.jl#985, this reduces
allocations on a typical request by about ~100. The main wins here are
hard-coding TCPSocket as the `io` field of `SSLStream` (which we assume
anyway), and changing the `geterror` function to a macro to avoid the
closure boxing problem.

* Run HTTP.jl tests on changes in OpenSSL

* fix
@quinnj quinnj merged commit a2bc2e0 into master Jan 7, 2023
@quinnj quinnj deleted the jq-avoid-dynamic-dispatch branch January 7, 2023 07:09
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.

2 participants