Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-104150

reduce qmlls read latency

    XMLWordPrintable

    Details

    • Epic Link:
    • Commits:
      1c7c277bf1 (qt/qtdeclarative/dev) 1c7c277bf1 (qt/tqtc-qtdeclarative/dev) e47a6cf215 (qt/qtdeclarative/6.4) e47a6cf215 (qt/tqtc-qtdeclarative/6.4)

      Description

      StdinReader::run() (qmllanguageservertool.cpp) just uses readSome, which might read nothing (and on several platforms that is what it does), and so we read a single character, and then sends it via signal to another thread.

      This is rather expensive, we should read larger chunks to be more efficient, but we should never wait for more data if a full message was already read (to avoid deadlocks).

      In the qtlanguageserver module QHttpMessageStreamParser does parse chunks, and calls a callback with the messages, and is set up in the QLanguageServerJsonRpcTransport constructor (see the initialization of m_messageStreamParser).

      A stupid but effective solution is to set up a QHttpMessageStreamParser in StdinReader::run(), collect all the read data in a single QByteArray, appending at the end, and in all callbacks of it send the collected data.

      This is a bit wasteful because the QHttpMessageStreamParser keeps a. copy of the sent message.

      It can be improved in two ways (in qtlanguageserver):

      1. allow the FSM in QHttpMessageStreamParser to be used without keeping any buffers
      2. change QLanguageServerJsonRpcTransport (or create another class), so that it receives directly the errors/headers/fullMessages, and connect those via signals to the QHttpMessageStreamParser in StdinReader::run.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sami.shalayel Sami Shalayel
            Reporter:
            fawzi Fawzi Mohamed
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes