summaryrefslogtreecommitdiff
path: root/ev.pod
diff options
context:
space:
mode:
authorroot <root>2007-11-26 10:20:42 +0000
committerroot <root>2007-11-26 10:20:42 +0000
commit3ed29c5036af830bfd31a743094b587bc6aa1949 (patch)
tree979c57558625afd6238842bcb6212f82ae991d15 /ev.pod
parent0a92349530f48869656f6696a354e308bd233c72 (diff)
add some small complexities section
Diffstat (limited to 'ev.pod')
-rw-r--r--ev.pod29
1 files changed, 29 insertions, 0 deletions
diff --git a/ev.pod b/ev.pod
index b988e08..cab6e18 100644
--- a/ev.pod
+++ b/ev.pod
@@ -1162,6 +1162,7 @@ pseudo-code only of course:
io_cb (ev_loop *loop, ev_io *w, int revents)
{
// set the relevant poll flags
+ // could also call adns_processreadable etc. here
struct pollfd *fd = (struct pollfd *)w->data;
if (revents & EV_READ ) fd->revents |= fd->events & POLLIN;
if (revents & EV_WRITE) fd->revents |= fd->events & POLLOUT;
@@ -1757,6 +1758,34 @@ And a F<ev_cpp.C> implementation file that contains libev proper and is compiled
#include "ev_cpp.h"
#include "ev.c"
+
+=head1 COMPLEXITIES
+
+In this section the complexities of (many of) the algorithms used inside
+libev will be explained. For complexity discussions about backends see the
+documentation for C<ev_default_init>.
+
+=over 4
+
+=item Starting and stopping timer/periodic watchers: O(log skipped_other_timers)
+
+=item Changing timer/periodic watchers (by autorepeat, again): O(log skipped_other_timers)
+
+=item Starting io/check/prepare/idle/signal/child watchers: O(1)
+
+=item Stopping check/prepare/idle watchers: O(1)
+
+=item Stopping an io/signal/child watcher: O(number_of_watchers_for_this_(fd/signal/pid % 16))
+
+=item Finding the next timer per loop iteration: O(1)
+
+=item Each change on a file descriptor per loop iteration: O(number_of_watchers_for_this_fd)
+
+=item Activating one watcher: O(1)
+
+=back
+
+
=head1 AUTHOR
Marc Lehmann <libev@schmorp.de>.