• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum
    • Categories
    • Recent
    • Popular
    • Tags
    • Register
    • Login

    [ANSWERED] Calculation overhead: Javascript vs calculators

    How To... ?
    4
    7
    179
    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.
    • J
      jtsteph
      last edited by Woland

      I have a quick questions about system overhead as I embark of a patch that will be replicated many dozens of times. Is the overhead of using Javascript greater for doing nestled math calculations vs stringing calculators together in a user actor to do the same calculation?

      A couple of examples of a math formula that I am using would be:

      B = ((T - 1) * 18) + ((P - 2) * 2) + 1

      L=((P−2)mod3)×32+1

      It much easier to put these together in Javascript, but I can do them with calculators if its quicker.

      Thanks, J

      W11 PRO 13700K (in a 4U case), 128GB RAM, 4 Lane M.2 Storage, RTX 3090, Behringer UMC404HD audio interface, Streamdeck XL, Stremdeck +, KorgNano Kontrol2, Izzy 3.26 USB
      Website: http://justinstephenson.com

      JuriaanJ WolandW DusXD 3 Replies Last reply Reply Quote 1
      • JuriaanJ
        Juriaan Tech Staff @jtsteph
        last edited by

        @jtsteph

        It depends on the amount of replications and this is such a deep technical question that we really have to dive deep into the codebase to figure this out for you 🙂


        For example I dont know or JavaScript code that is in memory needs to be re-initiliazed.

        Isadora 3.1.1, Dell XPS 17 9710, Windows 10
        Interactive Performance Designer, Freelance Artist, Scenographer, Lighting Designer, TroikaTronix Community moderator
        Always in for chatting about interaction in space / performance design. Drop me an email at hello@juriaan.me

        J 1 Reply Last reply Reply Quote 1
        • J
          jtsteph @Juriaan
          last edited by

          @juriaan Ahaha. Understood. I thought it might be a simple answer. I know you have much more important things to do.  I will just try some stuff and see where I end up. Thanks for reponding.

          W11 PRO 13700K (in a 4U case), 128GB RAM, 4 Lane M.2 Storage, RTX 3090, Behringer UMC404HD audio interface, Streamdeck XL, Stremdeck +, KorgNano Kontrol2, Izzy 3.26 USB
          Website: http://justinstephenson.com

          JuriaanJ 1 Reply Last reply Reply Quote 0
          • JuriaanJ
            Juriaan Tech Staff @jtsteph
            last edited by

            @jtsteph

            Happy to dive deeper with you, but I dont have an answer for you at this moment.

            Will do some testing on my own and report back

            Isadora 3.1.1, Dell XPS 17 9710, Windows 10
            Interactive Performance Designer, Freelance Artist, Scenographer, Lighting Designer, TroikaTronix Community moderator
            Always in for chatting about interaction in space / performance design. Drop me an email at hello@juriaan.me

            1 Reply Last reply Reply Quote 1
            • WolandW
              Woland Tech Staff @jtsteph
              last edited by

              @jtsteph

              My gut feeling is that JavaScript is less work for the computer, but as @Juriaan said, I don't believe there's a "one-size-fits-all" answer in that it probably depends on the complexity of what you're doing and how you're doing it. 

              @DusX might know better than me.

              TroikaTronix Technical Support
              New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
              TroikaTronix Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
              TroikaTronix Add-Ons Page: https://troikatronix.com/add-ons/

              | Isadora 3.2.6 | Mac Pro (Late 2013), macOS 10.14.6, 3.5GHz 6-core, 1TB SSD, 64GB RAM, Dual AMD FirePro D700s |

              1 Reply Last reply Reply Quote 1
              • DusXD
                DusX Tech Staff @jtsteph
                last edited by

                @jtsteph said:

                It much easier to put these together in Javascript, but I can do them with calculators if its quicker

                 When we first added the Javascript actor, I did a series of deep tests to determine exactly this. What I found was that I could use hundreds/thousands of JS actors doing math and still have good performance... and I could also use Thousands of the Calculator actors.

                I suspect you will have very similar performance either way, however; I believe a series of Calculator actors will be slightly less heavy.

                Due to the nature and easy of doing this in JS, I would personally use JS. But you could easily build both and use a global to switch between the methods used.. allowing you to make a change if performance required it.

                Troikatronix Technical Support

                • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                • Isadora Add-ons: https://troikatronix.com/add-ons/
                • My Add-ons: https://troikatronix.com/add-ons/?u=dusx

                Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                J 1 Reply Last reply Reply Quote 2
                • J
                  jtsteph @DusX
                  last edited by

                  @dusx Thanks. Given this, as most of my calculators are used in momentary situations (button press, dial turn) I think that Javascript makes more sense. It greatly simplifies my patching. If I run into a situation where they are updating as a stream, I'll try to use calculators. 

                  I appreciate your input. 


                  Best, J

                  W11 PRO 13700K (in a 4U case), 128GB RAM, 4 Lane M.2 Storage, RTX 3090, Behringer UMC404HD audio interface, Streamdeck XL, Stremdeck +, KorgNano Kontrol2, Izzy 3.26 USB
                  Website: http://justinstephenson.com

                  1 Reply Last reply Reply Quote 2
                  • First post
                    Last post