Pass large QVariantMap to JavaScript how to improve performance?



  • I have an application with a C++ QT backend + html/javascript frontend. I'm using the Html5ApplicationViewer generated by qcreator, without tourching it.

    For some operations, the backend generates large QVariantMap objects that are passed to the javascript frontend. I'm having a performance problem with this.

    From very simple testing is seems that two tasks are contributing to most of the cost of this operation:

    A) c++ code that prepares the QVariantMap object that will be passed to Javascript. This may be caused by the fact that inserting data into a QVariantMap creates a copy of the data, which then cannot be modified. Consider, for instance, the case of creating the object {a: {list: [long array]}}.

    B) converting the QVariantMap into a javascript object.

    Do you know any way of improving the performance of these two tasks? For instance, are there alternatives to QVariantMap to exchange data between c++ and javascript?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.