IO::Lambda::Socket::TCPServerとPOE::Component::Server::TCPとのベンチ
承前→POE::Component::Server::TCPとIO::Lambda::Socket::TCPServerのちょっとしたベンチ - taiyoh独言
これは自分でも流石にアレだと思ってたので、いい機会と思ってBenchmarkも少し覚えました。
ベンチマーク自体のイテレーションは1回しかしてないけど、ソケットサーバの生成コストより、ソケット通信そのもののコストを見たかったので、その辺のイテレーションとかはTest::TCPの中でやってるので、勘弁してください><
そのベンチスクリプトはこちら→http://github.com/taiyoh/io-lambda-socket-tcpserver/blob/3c642d919d599c7f02f3763ea9302784ebf18c31/eg/bench.pl
結果はこんな感じ
Benchmark: timing 1 iterations of lambda, poco... lambda: 3 wallclock secs ( 1.15 usr 0.82 sys + 1.78 cusr 0.03 csys = 3.78 CPU) @ 0.26/s (n=1) (warning: too few iterations for a reliable count) poco: 7 wallclock secs ( 1.20 usr 0.81 sys + 5.70 cusr 0.02 csys = 7.73 CPU) @ 0.13/s (n=1) (warning: too few iterations for a reliable count) s/iter poco lambda poco 7.73 -- -51% lambda 3.78 104% --
see also(上の結果と同じですが、ズレとかないです) : http://github.com/taiyoh/io-lambda-socket-tcpserver/blob/3c642d919d599c7f02f3763ea9302784ebf18c31/eg/results.txt
あとはテストか…。ネットワーク系のテストは(自分にとっと)ムズいお…