ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent.pm (file contents):
Revision 1.78 by root, Fri Apr 25 09:06:27 2008 UTC vs.
Revision 1.80 by root, Fri Apr 25 09:11:59 2008 UTC

921=head2 Discussion 921=head2 Discussion
922 922
923The benchmark does I<not> measure scalability of the event loop very 923The benchmark does I<not> measure scalability of the event loop very
924well. For example, a select-based event loop (such as the pure perl one) 924well. For example, a select-based event loop (such as the pure perl one)
925can never compete with an event loop that uses epoll when the number of 925can never compete with an event loop that uses epoll when the number of
926file descriptors grows high. In this benchmark, only a single filehandle 926file descriptors grows high. In this benchmark, all events become ready at
927is used (although some of the AnyEvent adaptors dup() its file descriptor 927the same time, so select/poll-based implementations get an unnatural speed
928to worka round bugs). 928boost.
929 929
930C<EV> is the sole leader regarding speed and memory use, which are both 930C<EV> is the sole leader regarding speed and memory use, which are both
931maximal/minimal, respectively. Even when going through AnyEvent, there are 931maximal/minimal, respectively. Even when going through AnyEvent, there are
932only two event loops that use slightly less memory (the C<Event> module 932only two event loops that use slightly less memory (the C<Event> module
933natively and the pure perl backend), and no faster event models, not even 933natively and the pure perl backend), and no faster event models, not even
962 962
963C<POE>, regardless of underlying event loop (wether using its pure perl 963C<POE>, regardless of underlying event loop (wether using its pure perl
964select-based backend or the Event module) shows abysmal performance and 964select-based backend or the Event module) shows abysmal performance and
965memory usage: Watchers use almost 30 times as much memory as EV watchers, 965memory usage: Watchers use almost 30 times as much memory as EV watchers,
966and 10 times as much memory as both Event or EV via AnyEvent. Watcher 966and 10 times as much memory as both Event or EV via AnyEvent. Watcher
967invocation is almost 700 times slower than with AnyEvent's pure perl 967invocation is almost 900 times slower than with AnyEvent's pure perl
968implementation. The design of the POE adaptor class in AnyEvent can not 968implementation. The design of the POE adaptor class in AnyEvent can not
969really account for this, as session creation overhead is small compared 969really account for this, as session creation overhead is small compared
970to execution of the state machine, which is coded pretty optimally within 970to execution of the state machine, which is coded pretty optimally within
971L<AnyEvent::Impl::POE>. POE simply seems to be abysmally slow. 971L<AnyEvent::Impl::POE>. POE simply seems to be abysmally slow.
972 972

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines