Rewriting trading systems in Rust (non-blocking I/O selectors)


#1

We would like to write some of our high-performance components (specially CoralReactor) in Rust for speed comparison. When it comes to trading systems, one of the most important component in terms of performance is network I/O. Does Rust currently handle non-blocking network I/O through selectors? Is there any EPoll selector implementation in Rust?

The benchmark we are trying to run is very simple: send a 256-byte message (through UDP or TCP) to a echo server and time the round-trip time. The full details are here: http://www.coralblocks.com/index.php/2014/04/coralreactor-performance-numbers/

Is it possible?


#2

The mio library sounds like what you’re looking for. It’s essentially an epoll wrapper but is additionally cross platform (kqueue on bsd derivatives, iocp in windows).


#3

mio is the low-level EPoll library to use. If you want a higher level library, check out tokio.


#4

@rdalmeida , you should know that this is an area of very heavy development in Rust. It’s still early days, but the tokio ecosystem is gearing up for an initial release, which is very exciting. It’s a video, but i highly recommend

for an overview of what’s going on in this space, and soon we’ll have some good textual resources to link you to.