[Interest] How to speed-up chameleons

igor.mironchik at gmail.com igor.mironchik at gmail.com
Thu Jun 12 12:37:48 CEST 2014


Ah, ok. I understand. You suggest to not use signals/slots and use semaphore instead.

Well. I think this will improve performance. But it will not use messaging system of Qt :)

From: igor.mironchik at gmail.com 
Sent: Thursday, June 12, 2014 12:29 PM
To: Romain Beaumont 
Cc: interest at qt-project.org 
Subject: Re: [Interest] How to speed-up chameleons

Hi.

What might be faster? One more synchronization primitive in the code will increase performance?

From: Romain Beaumont 
Sent: Thursday, June 12, 2014 9:48 AM
To: Igor Mironchik 
Cc: interest at qt-project.org 
Subject: Re: [Interest] How to speed-up chameleons

It might not be necessary (ie you can use something else instead) but it might be faster ;)



2014-06-12 8:22 GMT+02:00 <igor.mironchik at gmail.com>:

  Hi.

  First chameleon waits for another, i.e. he doing nothing while another will not come to the meeting place. And here semaphore is not necessary.

  Most slow place is QEventDispatcherWin32::processEvents()

  From: Romain Beaumont 
  Sent: Wednesday, June 11, 2014 7:54 PM
  To: Igor Mironchik 
  Cc: interest at qt-project.org 
  Subject: Re: [Interest] How to speed-up chameleons

  "first chameleon should wait a second;" this sound like semaphore to me, but I don't know this chameleon problem. 
  What part of Qt is causing it to be slow ? QThread ? the signal/slot ? 



  2014-06-11 18:51 GMT+02:00 <igor.mironchik at gmail.com>:

    Hi.

    What do you suggest?

    From: Romain Beaumont 
    Sent: Wednesday, June 11, 2014 5:12 PM
    To: Keith Gardner 
    Cc: igor.mironchik at gmail.com ; interest at qt-project.org 
    Subject: Re: [Interest] How to speed-up chameleons

    Hi, 
    Why do you need to use Qt signals/slots ?
    Isn't there something more appropriate to this task ?



    2014-06-11 15:36 GMT+02:00 Keith Gardner <kreios4004 at gmail.com>:

        I have one question to you. Why new syntax of QObject::connect() improve performance for a 5%.

        I mean that if in code change

        connect( sender, SIGNAL( signal() ), receiver, SLOT( slot() ) );

        to

        connect( sender, &Sender::signal, receiver, &Receiver::slot );

        then code works faster... Why? May be somebody know the answer, I don’t want to read Qt’s code for the answer on this question.

      I would guess would be that the first connect is performing a string lookup and validating the arguments at run time.  SIGNAL and SLOT are taking the macro parameters and turning them into character arrays.

      The second connect is working with function pointers which allows for the compiler validate their existence and ensure that the arguments are compatible at compile time instead of run time.

      _______________________________________________
      Interest mailing list
      Interest at qt-project.org
      http://lists.qt-project.org/mailman/listinfo/interest




    _______________________________________________
    Interest mailing list
    Interest at qt-project.org
    http://lists.qt-project.org/mailman/listinfo/interest



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140612/6cb87977/attachment.html>


More information about the Interest mailing list