~lubuntu-dev/lxde/libqtxdg

Viewing all changes in revision 292.

  • Committer: Alf Gaida
  • Author(s): Luís Pereira
  • Date: 2018-01-12 02:47:21 UTC
  • Revision ID: git-v1:39e75f071f3fc87ab19e43286c4ee5ecdc2efebb
Normalize signal/slot signatures

QObject::connect() brings a severe performance penalty when not using
normalized signatures. Signal lookup is first attempted with the signature
as-is, and if that fails QMetaObject::normalizedSignature() called.

That means, when using non-normalized signal/slot signatures, you not only
pay for a strcpy(), but also for a doomed-to-fail first lookup attempt.
Sure, connects are usually done during startup, and a profiler won’t show
you, but using non-normalized signatures is hereby firmly put into the
realm of premature pessimisation.

Reference:
https://marcmutz.wordpress.com/effective-qt/prefer-to-use-normalised-signalslot-signatures/

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: