[RFC] [WIP] tevent/glib integration

Ralph Boehme rb at sernet.de
Tue Jan 26 08:15:40 UTC 2016


On Tue, Jan 26, 2016 at 09:05:03AM +0100, Ralph Boehme wrote:
> >   >- run g_main_context_check/g_main_context_dispatch in a loop until
> > g_main_context_check returns false'
> > 
> > that sounds suspiciously like you are artificially tweaking the priority
> > (in other word the priority passed into g_main_context_check probably
> > determines whether an event source is marked as ready for dispatch or
> > not) if that is the case I'd say you are playing with fire,  I bet
> > without the change above the performance sucks ?
> 
> no it doesn't suck, it just takes three times as long.
> 
> The plan was to fix this short circuiting anyway, by calling the
> tevent_glib_prepare(). I've updated the branch with this change, it
> now takes twice as long as native glib (~0.8 ms compared to ~0.4 ms on
> my system where the tracker SPARQL query got ~220 results).

and with another fix:

--- a/lib/tevent/tevent_glib.c
+++ b/lib/tevent/tevent_glib.c
@@ -348,7 +348,8 @@ static bool get_glib_fds_and_timeout(struct
tevent_glib_glue *glue)
        glue->gpollfds = fds;
	        glue->num_gpollfds = num_fds;

-       if (timeout >= 0) {
+       ZERO_STRUCT(glue->gtimeout);
+       if (timeout > 0) {
                uint64_t microsec = timeout * 1000;

performance is on par with native glib. :)

-Ralph

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de,mailto:kontakt@sernet.de



More information about the samba-technical mailing list