hashrocket / websocket-shootout

A comparison of websocket servers in multiple languages and frameworks
MIT License
429 stars 76 forks source link

Add several threaded implementations for Rust #26

Closed jgulotta closed 8 years ago

jgulotta commented 8 years ago

I've moved the basic single threaded implementation into its own module, and added several simple threaded implementations: mioco, scoped-pool, and threadpool.

The actual executable must now be run with an argument to choose which implementation to use. Options are "ws", "scopedpool-ws", "threadpool-ws", "mioco-ws". For example, bin/rust-ws-server mioco-ws. Threads can be tuned with a --thread/-t parameter.

All the variations run on my computer and use more than one CPU. I didn't really see much better performance but I suspect that's due to running everything including the bencher locally. Maybe if they don't actually perform well someone else will take up the mantle of fixing them :).

Very interested to see how these compare when run in a more appropriate testing environment.

jackc commented 8 years ago

Thanks! I ran some preliminary tests and threadpool-ws seemed to perform best beating the single threaded by about 30%. mioco_ws just hung. Not sure what was going on there.