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.219 by root, Thu Jun 25 11:16:08 2009 UTC vs.
Revision 1.220 by root, Thu Jun 25 14:27:18 2009 UTC

1695 EV/Any 100000 224 2.88 0.34 0.27 EV + AnyEvent watchers 1695 EV/Any 100000 224 2.88 0.34 0.27 EV + AnyEvent watchers
1696 CoroEV/Any 100000 224 2.85 0.35 0.28 coroutines + Coro::Signal 1696 CoroEV/Any 100000 224 2.85 0.35 0.28 coroutines + Coro::Signal
1697 Perl/Any 100000 452 4.13 0.73 0.95 pure perl implementation 1697 Perl/Any 100000 452 4.13 0.73 0.95 pure perl implementation
1698 Event/Event 16000 517 32.20 31.80 0.81 Event native interface 1698 Event/Event 16000 517 32.20 31.80 0.81 Event native interface
1699 Event/Any 16000 590 35.85 31.55 1.06 Event + AnyEvent watchers 1699 Event/Any 16000 590 35.85 31.55 1.06 Event + AnyEvent watchers
1700 IOAsync/Any 16000 989 38.10 32.77 11.13 via IO::Async::Loop::IO_Poll
1701 IOAsync/Any 16000 990 37.59 29.50 10.61 via IO::Async::Loop::Epoll
1700 Glib/Any 16000 1357 102.33 12.31 51.00 quadratic behaviour 1702 Glib/Any 16000 1357 102.33 12.31 51.00 quadratic behaviour
1701 Tk/Any 2000 1860 27.20 66.31 14.00 SEGV with >> 2000 watchers 1703 Tk/Any 2000 1860 27.20 66.31 14.00 SEGV with >> 2000 watchers
1702 POE/Event 2000 6328 109.99 751.67 14.02 via POE::Loop::Event 1704 POE/Event 2000 6328 109.99 751.67 14.02 via POE::Loop::Event
1703 POE/Select 2000 6027 94.54 809.13 579.80 via POE::Loop::Select 1705 POE/Select 2000 6027 94.54 809.13 579.80 via POE::Loop::Select
1704 1706
1733performance becomes really bad with lots of file descriptors (and few of 1735performance becomes really bad with lots of file descriptors (and few of
1734them active), of course, but this was not subject of this benchmark. 1736them active), of course, but this was not subject of this benchmark.
1735 1737
1736The C<Event> module has a relatively high setup and callback invocation 1738The C<Event> module has a relatively high setup and callback invocation
1737cost, but overall scores in on the third place. 1739cost, but overall scores in on the third place.
1740
1741C<IO::Async> performs admirably well, about on par with C<Event>, even
1742when using its pure perl backend.
1738 1743
1739C<Glib>'s memory usage is quite a bit higher, but it features a 1744C<Glib>'s memory usage is quite a bit higher, but it features a
1740faster callback invocation and overall ends up in the same class as 1745faster callback invocation and overall ends up in the same class as
1741C<Event>. However, Glib scales extremely badly, doubling the number of 1746C<Event>. However, Glib scales extremely badly, doubling the number of
1742watchers increases the processing time by more than a factor of four, 1747watchers increases the processing time by more than a factor of four,
1820it to another server. This includes deleting the old timeout and creating 1825it to another server. This includes deleting the old timeout and creating
1821a new one that moves the timeout into the future. 1826a new one that moves the timeout into the future.
1822 1827
1823=head3 Results 1828=head3 Results
1824 1829
1825 name sockets create request 1830 name sockets create request
1826 EV 20000 69.01 11.16 1831 EV 20000 69.01 11.16
1827 Perl 20000 73.32 35.87 1832 Perl 20000 73.32 35.87
1833 IOAsync 20000 157.00 98.14 epoll
1834 IOAsync 20000 159.31 616.06 poll
1828 Event 20000 212.62 257.32 1835 Event 20000 212.62 257.32
1829 Glib 20000 651.16 1896.30 1836 Glib 20000 651.16 1896.30
1830 POE 20000 349.67 12317.24 uses POE::Loop::Event 1837 POE 20000 349.67 12317.24 uses POE::Loop::Event
1831 1838
1832=head3 Discussion 1839=head3 Discussion
1833 1840
1834This benchmark I<does> measure scalability and overall performance of the 1841This benchmark I<does> measure scalability and overall performance of the
1835particular event loop. 1842particular event loop.
1837EV is again fastest. Since it is using epoll on my system, the setup time 1844EV is again fastest. Since it is using epoll on my system, the setup time
1838is relatively high, though. 1845is relatively high, though.
1839 1846
1840Perl surprisingly comes second. It is much faster than the C-based event 1847Perl surprisingly comes second. It is much faster than the C-based event
1841loops Event and Glib. 1848loops Event and Glib.
1849
1850IO::Async performs very well when using its epoll backend, and still quite
1851good compared to Glib when using its pure perl backend.
1842 1852
1843Event suffers from high setup time as well (look at its code and you will 1853Event suffers from high setup time as well (look at its code and you will
1844understand why). Callback invocation also has a high overhead compared to 1854understand why). Callback invocation also has a high overhead compared to
1845the C<< $_->() for .. >>-style loop that the Perl event loop uses. Event 1855the C<< $_->() for .. >>-style loop that the Perl event loop uses. Event
1846uses select or poll in basically all documented configurations. 1856uses select or poll in basically all documented configurations.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines