Re: Signal emission far to slow
- From: Alex Larsson <alexl redhat com>
- To: <gtk-devel-list gnome org>
- Subject: Re: Signal emission far to slow
- Date: Sun, 27 May 2001 00:11:15 -0400 (EDT)
Following up to myself here. After an irc discussion with jamesh I added
to the test an extra signal much like the "string" one, but this one had
the argument using G_SIGNAL_TYPE_STATIC_SCOPE, and boy does this make a
difference:
Testing signal emissions with no installed handlers
===================================================
100000 nop emits by name in 1528 milliseconds
100000 integer emits by name in 1803 milliseconds
100000 string emits by name in 1900 milliseconds
100000 nop emits by id in 1019 milliseconds
100000 integer emits by id in 1258 milliseconds
100000 string emits by id in 1754 milliseconds
100000 sstring emits by id in 1278 milliseconds
Testing signal emissions with one null handler
==============================================
100000 nop emits by name in 1783 milliseconds
100000 integer emits by name in 2131 milliseconds
100000 string emits by name in 2226 milliseconds
100000 nop emits by id in 1252 milliseconds
100000 integer emits by id in 1624 milliseconds
100000 string emits by id in 2275 milliseconds
100000 sstring emits by id in 1314 milliseconds
Testing signal emissions with ten null handlers
===============================================
100000 nop emits by name in 3000 milliseconds
100000 integer emits by name in 3941 milliseconds
100000 string emits by name in 4089 milliseconds
100000 nop emits by id in 2483 milliseconds
100000 integer emits by id in 3423 milliseconds
100000 string emits by id in 4152 milliseconds
100000 sstring emits by id in 1313 milliseconds
Notice that sstring emits with ten handlers is basically the same speed as
with zero handlers. Whereas string is four times slower.
It still doesn't fix the problem with the cost of the zero-handler case
though.
/ Alex
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]