summaryrefslogtreecommitdiff
path: root/src/webchannel/qmetaobjectpublisher_p.h
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2013-12-19 20:07:46 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-27 15:51:27 +0100
commit13aee32e61f20e05fea18a26d35e610fb0e3081f (patch)
treecb56a6c5eccddd45042864c1de3d49bcb4122d5e /src/webchannel/qmetaobjectpublisher_p.h
parenta001534f832e58cc081512e12a4b7266489f2ad7 (diff)
downloadqtwebchannel-13aee32e61f20e05fea18a26d35e610fb0e3081f.tar.gz
Optimize client initialization by using QJson directly.
Before, we constructed QVariant maps and lists and then converted them to JSON to send the data to the webchannel. By obsoleting the conversion step, benchInitializeClients shows a good performance boost of ca. 19% (11.81ms vs 14.58ms). Change-Id: Ief8e8127207a046f481488a478cd6a18fa0ebffe Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'src/webchannel/qmetaobjectpublisher_p.h')
-rw-r--r--src/webchannel/qmetaobjectpublisher_p.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/webchannel/qmetaobjectpublisher_p.h b/src/webchannel/qmetaobjectpublisher_p.h
index e364510..969421a 100644
--- a/src/webchannel/qmetaobjectpublisher_p.h
+++ b/src/webchannel/qmetaobjectpublisher_p.h
@@ -80,7 +80,7 @@ struct Q_WEBCHANNEL_EXPORT QMetaObjectPublisherPrivate
* When receiving a notify signal, it will store the information in pendingPropertyUpdates which
* gets send via a Qt.propertyUpdate message to the server when the grouping timer timeouts.
*/
- void initializePropertyUpdates(const QObject *const object, const QVariantMap &objectInfo);
+ void initializePropertyUpdates(const QObject *const object, const QJsonObject &objectInfo);
/**
* Send the clients the new property values since the last time this function was invoked.
@@ -121,7 +121,7 @@ struct Q_WEBCHANNEL_EXPORT QMetaObjectPublisherPrivate
*
* TODO: support wrapping of initially-registered objects
*/
- QVariant wrapResult(const QVariant &result);
+ QJsonValue wrapResult(const QVariant &result);
/**
* Invoke delete later on @p object.
@@ -165,7 +165,7 @@ struct Q_WEBCHANNEL_EXPORT QMetaObjectPublisherPrivate
PendingPropertyUpdates pendingPropertyUpdates;
// Maps wrapped object to class info
- QHash<const QObject *, QVariantMap> wrappedObjects;
+ QHash<const QObject *, QJsonObject> wrappedObjects;
// Aggregate property updates since we get multiple Qt.idle message when we have multiple
// clients. They all share the same QWebProcess though so we must take special care to