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

memory allocations can lead to bad drawing performance

    XMLWordPrintable

    Details

    • Platform/s:
      WebAssembly

      Description

      We have a chat view which can show several animated images (loading animation). In combination with slots being called frequently on the main thread, this can lead to bad performance up to freezing.

      This is due to emscripten libraries which execute the event queue during mutexes. We manually patched emscripten to avoid deadlocks due to this, this means many of the events are kept in the event queue until the rendering returns to the main loop. This can make the problem even worse.

      Analysis has shown that during rendering often memory is allocated via dlmalloc/dlfree which then uses a mutex to get the memory. The mutex then causes slowdowns due to event processing. The problem gets worse the more events are send to the queue (e.g. from background threads).

      The suggested solution would be to have either an optimisation of the memory management in emscripten (which is preferable) or a custom memory pool per thread to avoid that for each allocation a mutex is required.

      At the time of writing we use emscripten 2.0.6.

        Attachments

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

          Activity

            People

            Assignee:
            sorvig Morten Sørvig
            Reporter:
            alexj Alexander Jährling
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes