HTTP.jl
HTTP.jl copied to clipboard
Reduce slightly allocations when reading/writing HTTP messages
- write direct to io rather than first creating strings
- we need to be careful to
stringany numbers before doing this, but doing this selectively still reduces allocations
- we need to be careful to
- don't create a
VersionNumberevery time we parse a message (inparse_status_line!/parse_request_line!), as theVersionNumberconstructor relies on regex matching which allocates, instead we can define out own much simpler type with allocation-free parsing
Together this takes a simple GET request from 170 -> 155 allocations
Codecov Report
Merging #950 (2fe988b) into master (7a54ffc) will decrease coverage by
0.62%. The diff coverage is85.93%.
:exclamation: Current head 2fe988b differs from pull request most recent head d59f8ae. Consider uploading reports for the commit d59f8ae to get more accurate results
@@ Coverage Diff @@
## master #950 +/- ##
==========================================
- Coverage 79.85% 79.23% -0.63%
==========================================
Files 36 36
Lines 2969 3010 +41
==========================================
+ Hits 2371 2385 +14
- Misses 598 625 +27
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/ConnectionPool.jl | 85.40% <ø> (-0.86%) |
:arrow_down: |
| src/Servers.jl | 79.47% <0.00%> (ø) |
|
| src/Strings.jl | 90.24% <79.48%> (-9.76%) |
:arrow_down: |
| src/Messages.jl | 86.04% <100.00%> (+0.08%) |
:arrow_up: |
| src/Parsers.jl | 97.29% <100.00%> (ø) |
|
| src/Streams.jl | 93.75% <100.00%> (-1.14%) |
:arrow_down: |
| src/clientlayers/MessageRequest.jl | 92.30% <100.00%> (ø) |
|
| src/access_log.jl | 80.00% <0.00%> (-13.34%) |
:arrow_down: |
| src/Exceptions.jl | 91.89% <0.00%> (-2.71%) |
:arrow_down: |
| src/connectionpools.jl | 70.70% <0.00%> (-2.03%) |
:arrow_down: |
| ... and 6 more |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
tests pass locally. not sure if we want to resolve #951 and get a clean CI run before merging here?