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.72 by root, Fri Apr 25 07:43:25 2008 UTC vs.
Revision 1.74 by root, Fri Apr 25 07:47:22 2008 UTC

935but this was not subjetc of this benchmark. 935but this was not subjetc of this benchmark.
936 936
937The C<Event> module has a relatively high setup and callback invocation cost, 937The C<Event> module has a relatively high setup and callback invocation cost,
938but overall scores on the third place. 938but overall scores on the third place.
939 939
940C<Glib>'s memory usage is quite a bit bit higher, features a faster 940C<Glib>'s memory usage is quite a bit bit higher, but it features a
941callback invocation and overall lands in the same class as C<Event>. 941faster callback invocation and overall ends up in the same class as
942C<Event>. However, Glib scales extremely badly, doubling the number of
943watchers increases the processing time by more than a factor of four,
944making it completely unusable when using larger numbers of watchers
945(note that only a single file descriptor was used in the benchmark, so
946inefficiencies of C<poll> do not account for this).
942 947
943The C<Tk> adaptor works relatively well, the fact that it crashes with 948The C<Tk> adaptor works relatively well. The fact that it crashes with
944more than 2000 watchers is a big setback, however, as correctness takes 949more than 2000 watchers is a big setback, however, as correctness takes
945precedence over speed. Nevertheless, its performance is surprising, as the 950precedence over speed. Nevertheless, its performance is surprising, as the
946file descriptor is dup()ed for each watcher. This shows that the dup() 951file descriptor is dup()ed for each watcher. This shows that the dup()
947employed by some adaptors is not a big performance issue (it does incur a 952employed by some adaptors is not a big performance issue (it does incur a
948hidden memory cost inside the kernel, though). 953hidden memory cost inside the kernel, though, that is not reflected in the
954figures above).
949 955
950C<POE>, regardless of underlying event loop (wether using its pure perl 956C<POE>, regardless of underlying event loop (wether using its pure perl
951select-based backend or the Event module) shows abysmal performance and 957select-based backend or the Event module) shows abysmal performance and
952memory usage: Watchers use almost 30 times as much memory as EV watchers, 958memory usage: Watchers use almost 30 times as much memory as EV watchers,
953and 10 times as much memory as both Event or EV via AnyEvent. Watcher 959and 10 times as much memory as both Event or EV via AnyEvent. Watcher
962Using EV through AnyEvent is faster than any other event loop, but most 968Using EV through AnyEvent is faster than any other event loop, but most
963event loops have acceptable performance with or without AnyEvent. 969event loops have acceptable performance with or without AnyEvent.
964 970
965The overhead AnyEvent adds is usually much smaller than the overhead of 971The overhead AnyEvent adds is usually much smaller than the overhead of
966the actual event loop, only with extremely fast event loops such as the EV 972the actual event loop, only with extremely fast event loops such as the EV
967adds Anyevent significant overhead. 973adds AnyEvent significant overhead.
968 974
969And you should simply avoid POE like the plague if you want performance or 975And you should simply avoid POE like the plague if you want performance or
970reasonable memory usage. 976reasonable memory usage.
971 977
972 978

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines