othiym23 / nonsense-benchmark

suite of servers that don't do anything very interesting, but do it very quickly (and asynchronously)
8 stars 15 forks source link

Threaded boost implementation. #26

Closed asm closed 11 years ago

othiym23 commented 11 years ago

Here's the non-threaded version:

Made 40000 requests in 19.25s.

Times in ms, min/mean/median/max (stddev)
Handled 40000 requests:         9.0/30.8/16.2/1563.6 (114.4)
IQR filtered to 37956 requests: 10.4/16.2/16.1/22.2 (2.0)
Throughput: 124.68krpm (IQR adjusted: 237.10krpm).

And the threaded version (with 70 threads):

Made 40000 requests in 21.19s.

Times in ms, min/mean/median/max (stddev)
Handled 40000 requests:         9.7/33.9/14.2/1114.0 (126.8)
IQR filtered to 37899 requests: 9.7/14.5/14.1/21.2 (2.3)
Throughput: 113.26krpm (IQR adjusted: 264.45krpm).

vs Jonathan's forking server (with 70 processes):

Made 40000 requests in 15.84s.

Times in ms, min/mean/median/max (stddev)
Handled 40000 requests:         9.9/25.3/12.4/1280.0 (114.4)
IQR filtered to 37074 requests: 9.9/13.0/12.3/17.7 (1.5)
Throughput: 151.52krpm (IQR adjusted: 296.21krpm).

vs Andrew's Haskell server:

Made 40000 requests in 14.82s.

Times in ms, min/mean/median/max (stddev)
Handled 40000 requests:         5.3/23.7/12.9/1243.2 (107.8)
IQR filtered to 39000 requests: 5.3/13.0/12.8/21.3 (3.0)
Throughput: 161.94krpm (IQR adjusted: 294.89krpm).

So faster, but not fastest!

asm commented 11 years ago

Doh, way too many threads. This implementation seems to have a heavy context switching penalty. It ran fastest on my 2 core (no HT) machine with 2 threads. On a 4 core machine such as your it should run optimally at 4 threads. I suppose I should have coded something to autoconfigure this....