[Development] qt_add/removeObject hooks

Branislav Katreniak katreniak at gmail.com
Wed Apr 16 14:46:56 CEST 2014


> As mentioned on https://codereview.qt-project.org/#change,83272 Kevin Funk
> measured the difference between the current approach and using atomics using
> Olivier's initial benchmark, it's about 4-5x slower for checking if there's a
> callback set. Since this is affecting every Qt application on a not uncommon
> hot path, I'd rather trade in theoretical tool stability for general
> performance.

The register / unregister methods can do the actual work in the
QApplication thread to avoid locking.
To support more callbacks, the pointer can be pointer to linked list
of function pointer + context instead of pure function pointer.

Kind regards
 Brano



More information about the Development mailing list