-
Notifications
You must be signed in to change notification settings - Fork 183
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
Added precompile workload #930
base: master
Are you sure you want to change the base?
Conversation
Review comment from a similar PR: #750 (comment) |
Well, that particular comment won't happen with the |
src/workload.jl
Outdated
resize!(empty!(Parsers.header_field_regex), Threads.nthreads()) | ||
resize!(empty!(Parsers.obs_fold_header_field_regex), Threads.nthreads()) | ||
resize!(empty!(Parsers.empty_header_field_regex), Threads.nthreads()) | ||
port, server = listenany(ip"0.0.0.0", 8080) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
port, server = listenany(ip"0.0.0.0", 8080) |
src/workload.jl
Outdated
port, server = listenany(ip"0.0.0.0", 8080) | ||
router = Router() | ||
register!(router, "GET", "/read/**", _ -> Response(200)) | ||
t = @async serve(router, "0.0.0.0", port, server=server) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t = @async serve(router, "0.0.0.0", port, server=server) | |
server = HTTP.serve!(router, "0.0.0.0"; listenany=true) | |
port = HTTP.port(server) |
src/workload.jl
Outdated
router = Router() | ||
register!(router, "GET", "/read/**", _ -> Response(200)) | ||
t = @async serve(router, "0.0.0.0", port, server=server) | ||
resp = get("http://localhost:$port/read//$(homedir())") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resp = get("http://localhost:$port/read//$(homedir())") | |
try | |
resp = get("http://localhost:$port/read//$(homedir())") | |
finally | |
close(server) | |
end |
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 |
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:
I had to do the
empty!(resize!(...))
in order not to trigger theaccess_threaded
assert.Let me know what you think!