Live data from Hacker News

Capnproto-rust vs. C++

dwrensha.github.io

11–12 of 12 posts

Re: Capnproto-rust vs. C++

#11
post #6
post #5

Earlier quoted context omitted.

I should note that the Rust version currently omits some features of the C++ version, such as read-limiting and the actual counting of the throughput. These things are cheap, but they may explain why Rust is faster in that one case.

We did some benchmarking on IRC today in light of this post and we found that Rust's stdio is currently quite slow due to a flag not being set properly in libuv which causes it to punt to a thread pool. There is currently a fix in the queue: https://github.com/mozilla/rust/pull/10558

In case you get some time would appreciate a blog post or a comment describing what the issue was on the rust side as well as on the libuv side. Upvoted in advance.

Re: Capnproto-rust vs. C++

#12
post #4
post #3

It'd be nice to see some description of which compiler, version and flags are used in each case.

Author here. The makefiles I'm using are on github: https://github.com/dwrensha/capnproto-rust/blob/master/Makef... https://github.com/dwrensha/capnproto/blob/benchmark/c%2B%2B... I compiled libcapnp with the latest Clang g++ that ships with XCode. It perhaps would be more fair to also compile the C++ benchmarks with Clang, instead of the Macports gcc4.8 that I'm using, but unfortunately Clang barfs on some template…

Update: the compilation error was actually due to some missing includes. https://github.com/kentonv/capnproto/pull/47

Switching compilers on the C++ side doesn't seem to make a significant difference in performance.

Post reply on HN