• Products
    • Isadora
    • Get It
    • ADD-ONS
    • IzzyCast
    • Get It
  • Forum
  • Help
  • Werkstatt
  • Newsletter
  • Impressum
  • Dsgvo
  • Press
  • Isadora
  • Get It
  • ADD-ONS
  • IzzyCast
  • Get It
  • Press
  • Dsgvo
  • Impressum
FORUM

Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags

    [ANSWERED] JavaScript/[Actor] Benchmarking...

    How To... ?
    3
    5
    750
    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.
    • clafarge
      clafarge Beta Tester last edited by Woland

      Is there a good way to benchmark efficiency, performance, and stability between different methods of doing a thing? I tend to lean toward JavaScript for many tasks. If a task is very simple/straightforward, I'll use other purpose-built Actors, but if I can reduce the number of Actors in use by having JavaScript do several of the steps a number of Actors would been used for, I happily take that path.

      I'm interested in learning a good way to make sure that I'm choosing the correct path. Your benchmarking tools/methods would be helpful in this journey.

      Thank you in advance.

      Chad

      Chad LaFarge | Isadora 3.2.6, Win 10 64bit, i9-10900KF @ 3.70GHz, 64.0 GB RAM, NVIDIA GeForce RTX 3080 10 GB VRAM

      Woland 1 Reply Last reply Reply Quote 0
      • Woland
        Woland Tech Staff @clafarge last edited by

        @clafarge said:

        Is there a good way to benchmark efficiency, performance, and stability between different methods of doing a thing?

        If you want to compare two ways of doing a thing, the only way I can think of is to actually do it both ways then compare the results (looking at cycles per second and LOAD at bottom right).

        My gut feeling is that replacing as many functions as possible with JS will generally be more efficient, but I could be wrong.

        I'm interested to hear what others have to say on the topic.

        Best wishes,

        Woland

        TroikaTronix Technical Support
        New Support Ticket: https://support.troikatronix.com/support/tickets/new
        Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
        Add-Ons: https://troikatronix.com/add-ons/ & https://troikatronix.com/add-ons/?u=woland
        Professional Services: https://support.troikatronix.com/support/solutions/articles/13000109444

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

        clafarge 1 Reply Last reply Reply Quote 1
        • clafarge
          clafarge Beta Tester @Woland last edited by

          @woland

          Thank you for the reply, and for moving this to a more appropriate place. I was thinking "Troubleshooting" as it's a cousin to benchmarking, but I agree: here is better.

          As a developer, I sometimes set up scenarios where I'll monitor the execution time, CPU load, memory usage, etc., while I loop [doing a thing] 10k/50k times, and compare the results of different methods. I have tools like C#'s stopwatch for timing/duration and system performance/resource monitors that are accessible via code. I might even set up a session to continue for hours and see if I can melt a server. I haven't been as adventurous in Isadora, as yet.

          I was hoping there were some known best-practices to draw from that address Isadora specifically, as it sort of operates differently from my normal environment.

          Best,

          Chad

          Chad LaFarge | Isadora 3.2.6, Win 10 64bit, i9-10900KF @ 3.70GHz, 64.0 GB RAM, NVIDIA GeForce RTX 3080 10 GB VRAM

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

            @clafarge

            When we first added Javascript to Isadora, I ran a number of tests to determine the efficiency of the JS actor.
            One of these tests was to recode the Smother actor in Javascript so that I had an identical process in JS. I then created Isadora patches with a thousand of the C++ version of smoother running, and the same for the JS version. What I saw was a very small increase in resources used for the JS processing. I continued to increase the number of actors and still saw only a slightly larger difference. Another test showed similar results for text formatting.

            My takeaway was that the JS actor ran comparably fast, and wouldn't make any notable difference when used in most cases. 
            However, do remember you can create large loops in JS, which will take more cpu time, as well as operations like array sorting etc.. 
            JS runs within the frameloop, and needs to return in a timely manner, it is Blocking, so if you run a long loop everything else in the patch has to wait for it to return.

            TRY THIS
            - Add a Shapes actor, connected to a projector and a Wave generator, so you see it moving in your stage preview
            Try adding this code to a JS actor and change the input value:

            function main()
            {
            for (let i = 0; i < 5000000; i++) {
              print ("..." + i)
            }
                return arguments[0];
            }

            You will see output freezes while the JS actor counts to 1/2 million in the Monitor window.

            Is it faster/slower to use JS to group a few functions together in a patch... I would say it is likely very close to the same cpu time (unless it's very complex)... does it save you the user time? probably if you are comfortable writing JS.

            Troikatronix Technical Support

            • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
            • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
            • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

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

            clafarge 1 Reply Last reply Reply Quote 3
            • clafarge
              clafarge Beta Tester @DusX last edited by

              @dusx

              That's a great help, thank you!

              Chad LaFarge | Isadora 3.2.6, Win 10 64bit, i9-10900KF @ 3.70GHz, 64.0 GB RAM, NVIDIA GeForce RTX 3080 10 GB VRAM

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