You're right, there's no benchmarks, thanks for the tip, I'll go for that. As for the lambda, it seemed somewhat natural for me back then - anonymous callback bound to IO... OTOH there would be no problem to make the lambda keyword an alias to another, less confusing name, so the only question is what that name should be? new_io_chain ? Doesn't sound... don't know really.
update: here's some premature benchmarks. the source code will be added to the next release, for now it's here
Single-process tcp client and server; server echoes back everything is sent by
the client. 500 connections sequentially created, instructed to send a single
line to the server, and destroyed.
2.4GHz x86-64 linux
Lambda using select 0.694 sec
Lambda using AnyEvent 0.684 sec
Raw sockets using select 0.145 sec
POE using select 5.349 sec
the POE numbers are somewhat strange. I might've done something wrong there, anyone interested is welcome to check tcp-poe.pl from the link above.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|