Forum
    • Categories
    • Register
    • Login

    Long loading times due to variable declaration

    Scheduled Pinned Locked Moved Solved Scripting
    5 Posts 2 Posters 28 Views
    Loading More Posts
    • 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.
    • Oli UllmannO
      Oli Ullmann
      last edited by Oli Ullmann

      Hello everyone! :-)

      I have a fairly extensive project with a lot of parameters and associated UI elements. I actually need dedicated sliders for most parameters in order to be able to use HISE's modulation capabilities. A slider with a callback that works depending on the situation is therefore not possible.

      My problem is that the project has very long loading times. In HISE, it takes about 23 seconds after I press “Compile.” And even the compiled plug-in takes a long time to load.

      I have discovered that this is due to my variable declarations. I have about 1000 lines of code that look something like this:

      const bigLeftKnobs = Content.getAllComponents(“^(?=.*lknb)(?!.*sknb).*$”);
      

      In another section of the code, I then assign callbacks and look-and-feels as follows:

      for(k in bigLeftKnobs)
      {
          k.setControlCallback(callbackFunction);
          k.setLocalLookAndFeel(lafFunction);
      }
      

      However, with

      const all = Content.getAllComponents(“”)
      

      I also get all UI elements, but this is extremely fast. My idea is therefore to get all UI elements this way and then assign them as follows:

      for(e in all)
      {
          if(e.getId().contains(“lknb”) && !e.getId().contains(“sknb”))
          {
              k.setControlCallback(callbackFunction);
              k.setLocalLookAndFeel(lafFunction);
          }
      {
      

      What do you think? That should speed up the loading process, right? I thought I'd ask around here, as it would probably take a few days to modify my code accordingly, and maybe one of you has an even better idea. :-)

      Thanks and all the best,
      Oli

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @Oli Ullmann
        last edited by

        @Oli-Ullmann said in Long loading times due to variable declaration:

        That should speed up the loading process, right?

        Yes, just having a single reference to each component instead of multiple is going to be better.

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        Oli UllmannO 1 Reply Last reply Reply Quote 1
        • Oli UllmannO
          Oli Ullmann @David Healey
          last edited by

          @David-Healey
          Okay, refactoring time. :-)
          How do you solve this problem in large projects? In a similar way?

          David HealeyD 1 Reply Last reply Reply Quote 0
          • David HealeyD
            David Healey @Oli Ullmann
            last edited by

            @Oli-Ullmann said in Long loading times due to variable declaration:

            How do you solve this problem in large projects? In a similar way?

            I use individual declarations most of the time, unless I have a group of controls that are related. I also use broadcasters when I can and assignments in the property editor instead of callbacks.

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            Oli UllmannO 1 Reply Last reply Reply Quote 0
            • Oli UllmannO
              Oli Ullmann @David Healey
              last edited by

              @David-Healey
              All right, thank you for your input! :-)

              1 Reply Last reply Reply Quote 0
              • Oli UllmannO Oli Ullmann has marked this topic as solved
              • First post
                Last post

              14

              Online

              2.1k

              Users

              13.3k

              Topics

              115.3k

              Posts