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. Where is the doc on migration from synchronous to deferred/batched reactions/effects?

Where is the doc on migration from synchronous to deferred/batched reactions/effects?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 532 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.
  • T Offline
    T Offline
    trusktr
    wrote on last edited by trusktr
    #1

    (I may not have the right terminology, it's been a while since I've been here).

    I remember that at one point, Qt made a fundamental change to reactivity, by making effects happen deferred rather than synchronously, for better performance (not running reactions too many times unnecessarily). It may have had to do with QML, but I don't recall.

    Where is the article or document that described this notable change? I'm having a hard time Googling for it.

    EDITS:

    Was it the QueuedConnection feature perhaps? Was it the firing of reactive JS expressions in QML?

    Hmm, in https://doc.qt.io/qt-5/qtquick-performance.html, it says

    If you have a loop where you do some processing, but only the final result of the processing is important, it is often better to update a temporary accumulator which you afterwards assign to the property you need to update, rather than incrementally updating the property itself, in order to avoid triggering re-evaluation of binding expressions during the intermediate stages of accumulation.

    I could have sworn this was the problem the feature that I'm remembering was supposed to solve, so that reactions would be batched in a future "task" (in JavaScript, it would be a microtask). I just don't remember where I read about this, or the terms used.

    Right now, the only feature I can find is QueuedConnection, and that if using that by default for all signal/slot connections, we'll be able to avoid a similar problem as described for QML property binding.

    Is this the only feature? Or was there another one, relating to deferring/batching updates?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Perhaps you are referring to texture atlas changes which landed many many years ago https://www.qt.io/blog/2013/09/02/new-scene-graph-renderer

      (Z(:^

      T 1 Reply Last reply
      1
      • sierdzioS sierdzio

        Perhaps you are referring to texture atlas changes which landed many many years ago https://www.qt.io/blog/2013/09/02/new-scene-graph-renderer

        T Offline
        T Offline
        trusktr
        wrote on last edited by
        #3

        @sierdzio hey, thanks. That does mention batching I n the renderer. What I remember though was an article that described a fundamental change to user code because reaction timing was changed such that reactions are deferred and batched. I can't find it, maybe because I don't remember the terms to search for. It was years ago indeed. Maybe it was another framework, although I thought it was Qt if I recall correctly. Plus the old sites and links pre-qt.io are gone, so maybe that makes it harder to find if it still exists, if my memory of it being Qt is correct.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Hmm then maybe you are referring to new C++ bindable properties https://www.qt.io/blog/all-about-property-bindings-in-qt-6.2

          (Z(:^

          T 1 Reply Last reply
          0
          • sierdzioS sierdzio

            Hmm then maybe you are referring to new C++ bindable properties https://www.qt.io/blog/all-about-property-bindings-in-qt-6.2

            T Offline
            T Offline
            trusktr
            wrote on last edited by trusktr
            #5

            @sierdzio Hmm, that indeed seems very similar to what I was asking about, and indeed describes the difference between synchronous-wanting code and the deferred dispatching. But in my mind I recall it being several years ago; by 2015 I got focused on web-based development.

            Was the deferred/lazy behavior also default for QML at any point?

            1 Reply Last reply
            0
            • T Offline
              T Offline
              trusktr
              wrote on last edited by trusktr
              #6

              Hmm yeah, looks like it was Qt 6: https://www.qt.io/blog/property-bindings-in-qt-6. Although in the 6.0 release post, which is what I was searching in when I opened the topic, it wasn't mentioned. I didn't think to search "property bindings deferred". That would have found it. The terms we've been using in web projects is reactive variables or "signals", and dependency-tracking effects or reactive computations.

              Did that deferred behavior apply to QML bindings too in 6.0?

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                Property bindings in QML were always deferred. Kind of.

                Not sure, sorry :D

                (Z(:^

                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