HTTP.jl icon indicating copy to clipboard operation
HTTP.jl copied to clipboard

Added precompile workload

Open louisponet opened this issue 3 years ago • 7 comments

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!

louisponet avatar Oct 03 '22 17:10 louisponet

Review comment from a similar PR: https://github.com/JuliaWeb/HTTP.jl/pull/750#issuecomment-927303657

rikhuijzer avatar Oct 03 '22 18:10 rikhuijzer

Well, that particular comment won't happen with the listenany I guess

louisponet avatar Oct 03 '22 19:10 louisponet

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.

quinnj avatar Oct 04 '22 05:10 quinnj

I’ll have a look, thanks!

louisponet avatar Oct 04 '22 06:10 louisponet

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)

louisponet avatar Oct 04 '22 06:10 louisponet

Hmmm, it looks like the client.jl tests are hanging, so maybe my theory wasn't quite right.

quinnj avatar Oct 04 '22 23:10 quinnj

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

louisponet avatar Oct 05 '22 07:10 louisponet