Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Pass large QVariantMap to JavaScript how to improve performance?
Qt 6.11 is out! See what's new in the release blog

Pass large QVariantMap to JavaScript how to improve performance?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 634 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    evilfer
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved