[Development] qt_add/removeObject hooks
Thiago Macieira
thiago.macieira at intel.com
Wed Apr 9 01:11:22 CEST 2014
Em ter 08 abr 2014, às 23:00:18, Olivier Goffart escreveu:
> > Performance-wise, I'd prefer empty functions that get overridden at
> > runtime. That's the smallest overhead for when they are not present.
>
> According to a quick benchmark (attached), it is clearly more efficient to
> have:
> if (callback) callback();
> where callback is a function pointer than always calling callback even if
> it is an empty function.
Thanks for the benchmark.
That basically settles it to an implementation like André's suggestion in the
other email, except with null pointers for the callbacks in the default case.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Development
mailing list