Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

" getting 1/3 sys usage and 5x throughput with custom batching" #496

Closed
ry opened this Issue · 4 comments

3 participants

@tj
tj commented

my benchmarks is pretty contrived but im doing 1000 messages per tick in this case. I initially figured node would wrap things up in iovecs but even doing some crappy custom batching really speeds things up, for larger messages it's slower since I have to copy though, definitely not idea. I might have time to look at it more today but here's the benchmark scripts:

https://github.com/visionmedia/super-sockets/blob/master/benchmark/pub.js
https://github.com/visionmedia/super-sockets/blob/master/benchmark/sub.js

and my lame batch mechanism:

https://github.com/visionmedia/super-sockets/blob/master/lib/batch.js

the logic right now is pretty ad-hoc too, no limiting on batch sizing etc, I'm just batching 10 messages or the ttl of 100ms but obviously libuv couldn't make assumptions like that.

https://github.com/visionmedia/super-sockets/blob/master/lib/sockets/pub.js#L37

@bnoordhuis

libuv writes iovec's right?

Only if you pass multiple uv_buf_t structs to uv_write(). Node never does that, though.

@tj
tj commented

ah ok thanks. I should have specified the node part in the tweet

@bnoordhuis bnoordhuis closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.