Added precompile workload
Hi All,
I've attempted to solve some of the TTFX things in HTTP.jl. By adding the small workload, the time to first return of the request in went down by a third (3.41s vs 5.1s) for this:
using HTTP
@time HTTP.post("http://httpbin.org/post"; body="hey")
I had to do the empty!(resize!(...)) in order not to trigger the access_threaded assert.
Let me know what you think!
Review comment from a similar PR: https://github.com/JuliaWeb/HTTP.jl/pull/750#issuecomment-927303657
Well, that particular comment won't happen with the listenany I guess
I think the issue w/ CI tests here is because we're starting the server on port 8080 during precompile and then it's not getting properly closed and then the tests are going haywire when they first try to run a server/request on port 8080. I've left some code review suggestions that should hopefully help w/ this.
I’ll have a look, thanks!
There are already some tests that actually rely on no server running on 8080, I'll add listenany to those as well if that's okay. (I incidentally had another server running on 8080 and so tests errored)
Hmmm, it looks like the client.jl tests are hanging, so maybe my theory wasn't quite right.
On my pc the same tests fail on this branch as on the main, not sure if that’s the same on the github ci though