Speed of max with javascript

Oct 16, 2012 at 6:45am

Speed of max with javascript

I read a topic somewhere about someone wondering why people were using js instead of java with max, even though java was hundreds of times faster.

How fast/slow is the use of javascript exactly? Is it wise to even use it? I have no intention of doing any audioprocessing with it, just pure midi.

#64798
Oct 16, 2012 at 6:47am

(Oops, put it in the wrong category)

#233679
Oct 16, 2012 at 9:43am

Hi Pvdn !!!
did u saw it ? http://cycling74.com/forums/topic.php?id=4492 . i had problems with huge amount of iterations , js even hanged my max :/ but with relaxed flow its working pretty well .
ive read somewhere (cant find the thread) that we should not rely on JS considering time sensitive operation ,there is small (but present) latency around 1 .. 5ms .

#233680
Oct 16, 2012 at 10:06am

I’m only doing some minor stuff: reading/setting the states of ui-elements, creating objects, storing/reading some internal data, etc.

By the way, I did some quick reading and was wondering: do you even have access to the patcher using java as with js (i.e. can you create or look up objects for example?).

#233681
Oct 16, 2012 at 10:13am

#1 . im using JS for a very very similar operations ,and im happy with JS untill now :)

#2. im pretty sure that you can do the same and even more :)

#233682
Oct 17, 2012 at 3:00pm

JavaScript, especially in Max 6, is pretty fast. The slowest part is usually to get in/out of the object. In the example you mentioned testing with uzi is not really the best use of javascript, a more fair comparaison would be to have the loop inside the js object.
It’s worth mentioning that it also depends how you write your code. For instance, using global variable can be significantly slower than using local variable.

#233683

You must be logged in to reply to this topic.