Calculator actor vs JavaScript
-
I am working on a patch with 300 incoming floating point streams via OSC, and I need to perform continuous math functions on these streams (=7500 calculations per second for 25 fps). It would be more convenient to do this through JavaScript actors than Calculator actors. Do math functions in JavaScript run faster or slower than in Calculator, or is there no difference?
thank you,
Don -
In my humble opinion, the best is to make prototype and compare the result. Unfortunately, javascript is not very fast for calculation, plus the time of translating from Isadora to JS and vice-versa. Visual programming as in Isadora is also not so efficient. OSC is also not a very efficient way of sending a huge stream of data.
The best solution would be to transform your numeric data in image (or stay with image if you analyse it) and use glsl shader to make calculation and produce images it, or use a software more able to do calculation, as Processing, TouchDesigner or OpenFrameWork and send the result as image via Syphon or Spout to Isadora.
It's difficult to discuss it without knowing from what come your streams, which calculation you want to do and which result you want to obtain…
Be more specific!
Jacques
-
When we first introduced the JS actor I wrote a JS script to match the built in 'smoother' actor.
I was able to run hundreds of this actor before any slowdown was apparent.
I believe the JS actor runs in a thread so that it doesn't slow the main Isadora process.
My feeling is that you should be able to do this.
I would be interested in knowing if there is a slight difference between all being processed in 1 JS actor versus splitting the load across multiple actors.
As mentioned above, JS isn't as fast as Isadoras native actors (written in c++).
So you always have the option of building this up as a user actor.
-
Jacques and Dusx, thank you for your comments. The data is coming in real-time from a Kinect, so I believe there is no option other than OSC. I did a test and I do not notice any speed difference between the two approaches, so I have used JavaScript.
Don