aboutsummaryrefslogtreecommitdiffstats
path: root/src/webchannel/qmetaobjectpublisher_p.h
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2013-12-28 15:43:09 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-08 15:04:34 +0100
commit2f7bef547e51ee6f2fe8f12bbe33f4978d6bd7f2 (patch)
treeb1699169a411ef7e013c97c8525745a9dd899b3a /src/webchannel/qmetaobjectpublisher_p.h
parent5354cb73e25afbdf55b78c29ca32c1b305aa7efe (diff)
Optimize: Use property-indices instead of names for notifications.
This reduces the traffic as the indices are usually much smaller than the property names. As such, the benchPropertyUpdates gets a speed boost of about 9% (or 10ms vs. 11ms). As we need to transmit the index during initialization that degrades its performance slightly by ca. 4% (13ms vs. 12.5ms). Considering that the initialization only takes place once whereas the property updates potentially often, this is a good tradeoff. Change-Id: If7df3e360f1528b7d7aa26c63ce851363ae9fd6a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/webchannel/qmetaobjectpublisher_p.h')
-rw-r--r--src/webchannel/qmetaobjectpublisher_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/webchannel/qmetaobjectpublisher_p.h b/src/webchannel/qmetaobjectpublisher_p.h
index 969421a..4df5b38 100644
--- a/src/webchannel/qmetaobjectpublisher_p.h
+++ b/src/webchannel/qmetaobjectpublisher_p.h
@@ -153,9 +153,9 @@ struct Q_WEBCHANNEL_EXPORT QMetaObjectPublisherPrivate
// Map the registered objects to their id.
QHash<const QObject *, QString> registeredObjectIds;
- // Map of object names to maps of signal indices to a set of all their properties.
+ // Map of objects to maps of signal indices to a set of all their property indices.
// The last value is a set as a signal can be the notify signal of multiple properties.
- typedef QHash<int, QSet<QString> > SignalToPropertyNameMap;
+ typedef QHash<int, QSet<int> > SignalToPropertyNameMap;
QHash<const QObject *, SignalToPropertyNameMap> signalToPropertyMap;
// Objects that changed their properties and are waiting for idle client.