Skip to content

Conversation

gbaraldi
Copy link
Member

@gbaraldi gbaraldi commented Oct 9, 2025

On a simple http benchmark this is a 7x throughput improvement.

On a simple http benchmark this is a 7x throughput improvement.
@vtjnash vtjnash added io Involving the I/O subsystem: libuv, read, write, etc. performance Must go faster merge me PR is reviewed. Merge when all tests are passing labels Oct 9, 2025
@gbaraldi
Copy link
Member Author

gbaraldi commented Oct 9, 2025

Motivating thing was https://github.com/AbhimanyuAryan/c_http_jl/ the remaining differences are, we always do async reads which might not be optimal, but libuv doesn't have a try_read (even thought it might eventually). The other is node seems to go into the writev call while we fall into write, and we plainly do a lot more write calls than they do. Not sure how much of this is on HTTP.jl and how much is on base.
Also HTTP.jl calls nagle lots of times while node doesn't seemt o call it very much at all

@PallHaraldsson

This comment was marked as off-topic.

@giordano
Copy link
Member

giordano commented Oct 9, 2025

On a simple http benchmark this is a 7x throughput improvement.

Can we actually see the benchmark?

@gbaraldi
Copy link
Member Author

gbaraldi commented Oct 9, 2025

const ROUTER = HTTP.Router()

HTTP.register!(ROUTER, "GET", "/", req->HTTP.Response(200, "Hi"))
# You can register more
HTTP.register!(ROUTER, "GET", "/bye", req->HTTP.Response(200, "Bye!"))
HTTP.serve(ROUTER)

and using https://www.npmjs.com/package/autocannon
It went from 100k requests to 700k requests on my laptop

@giordano giordano changed the title Try a blocking write before doing async write calll. Try a blocking write before doing async write call Oct 9, 2025
@IanButterworth IanButterworth removed the merge me PR is reviewed. Merge when all tests are passing label Oct 11, 2025
@IanButterworth
Copy link
Member

Build doesn't seem happy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

io Involving the I/O subsystem: libuv, read, write, etc. performance Must go faster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants