Created
March 16, 2019 00:07
-
-
Save non-Jedi/22f1d21925346fe8d05598257274c92f to your computer and use it in GitHub Desktop.
Benchmarking HTTP.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using HTTP | |
abstract type DummyConnectionLayer{Next <: HTTP.Layer} <: HTTP.Layer end | |
st = HTTP.RedirectRequest.RedirectLayer{HTTP.MessageRequest.MessageLayer{ | |
HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{ | |
DummyConnectionLayer{Union{}}}}}} | |
uri = HTTP.URI("https://example.com/random/path?query=param&foo=bar") | |
headers = HTTP.Headers() | |
function HTTP.request(::Type{DummyConnectionLayer{Next}}, url::HTTP.URI, req, body; | |
proxy=nothing, socket_type::Type=HTTP.TCPSocket, | |
reuse_limit::Int=HTTP.ConnectionPool.nolimit, kw...) where Next | |
HTTP.Response(200) | |
end#function | |
using BenchmarkTools | |
@btime HTTP.request($st, "POST", $uri, $headers, "hello") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment