diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-10-28 14:09:47 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-10-28 14:35:07 (GMT) |
commit | 5d8dcd57cd13fdd9c8643fa3bdda9f197a4351ff (patch) | |
tree | fe37e87419eeaf01b0f4a441b3694fac35e15111 /src/3rdparty/webkit/WebKit/qt/tests | |
parent | 36e362cffe74d8f7fb3eb6b6a67fbab2ebda1a21 (diff) | |
download | Qt-5d8dcd57cd13fdd9c8643fa3bdda9f197a4351ff.zip Qt-5d8dcd57cd13fdd9c8643fa3bdda9f197a4351ff.tar.gz Qt-5d8dcd57cd13fdd9c8643fa3bdda9f197a4351ff.tar.bz2 |
Greatly improve the performance of obtaining a state's transitions
Transitions are children of their source state. We use
QObject::children() and qobject_cast() each child to a
QAbstractTransition to see if it is indeed a transition. However,
calling qobject_cast() is very expensive. This commit introduces
a cached list of transitions. The list is invalidated after a
child object has been added or removed.
In the typical case we expect the object hierarchy to remain fairly
constant once the state machine has been started (states, child states
and transitions are usually "static"), in other words the cached list
is not likely to be invalidated much.
Obtaining a state's transitions needs to be as fast as possible
because it's in the critical path of the state machine algorithm.
Reviewed-by: Eskil Abrahamsen Blomfeldt
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/tests')
0 files changed, 0 insertions, 0 deletions