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