Using classes and JS performances ?

Jun 24, 2012 at 7:57am

Using classes and JS performances ?

Hi there,
are there some advices to use or not use classes in js executed in jsui ?
I’m building a small gui for myUniverse project with jsui/mgraphics and it would be useful to define some classes like vec3f, things like that.

Jun 24, 2012 at 4:22pm

Well, I’ve never avoided classes – in fact, I love ‘em. As long as you aren’t too kooky about the number of instances you create, you should be in good shape. Since internal to Javascript the classes are just variations on function pointers, you shouldn’t see a real hit to performance (this is just based on experience, not any specific knowledge of the turning gears in the system…).


Jun 24, 2012 at 4:35pm

Hi Darwin and thanks for your answer.
AFAIK, the JIT compiler processes the javascript and indeed it is VERY fast.

Your informations are precious.
I’m building the GUI of myUniverse system :)
Initially wanted to keep that outside of max and linked via OSC, but finally, integrating it right now inside Max!

Jun 25, 2012 at 1:58pm

i’m using lots of classes in JS and no problems at all.


You must be logged in to reply to this topic.