Are any GUI libs going to make use of signals/slots?
Craig Black
cblack at ara.com
Tue Dec 5 15:59:33 PST 2006
"clayasaurus" <clayasaurus at gmail.com> wrote in message
news:el4evq$1nbu$1 at digitaldaemon.com...
> Craig Black wrote:
>> Is anybody using or planning to use the new signal/slot feature? Seems
>> like
>> a powerful feature to me. I'm curious as to its percieved utility to GUI
>> library maintainers.
>>
>> -Craig
>
> I made a simple OpenGL based GUI for my little library that uses
> signal/slots (note I just recently completed it but haven't used it for
> any apps yet, except for test apps).
>
> It makes it really easy for users to hook up their own custom code to
> handle things such as buttons being clicked.
>
> One thing I'm curious about is the efficiency of signals and slots. I'm
> guessing it has slightly more overhead than a normal function call,
> therefore it is not something to be calling constantly.
>
> ~ Clay
As far as performance, I'm sure it's not that bad. It may be a little less
efficient than a regular function call, but since it's primarily used for
GUI-related stuff, this small overhead is trivial.
However, if you are concerned, you could do a benchmark. Put a call to a
signal inside a for loop that iterates a bunch of times, and time it. Test
it against a regular delegate invokation, and then a function call. It
would be interesting to see the results.
-Craig
More information about the Digitalmars-d-dwt
mailing list