Forums > Jitter

jit.op // jit.expr

July 15, 2007 | 12:53 pm

I get worse perfomances with jit.expr than jit.op for a simple addition.
Could someone confirm or explain ?

ex:

max v2;
#N vpatcher 559 71 1163 689;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 153 185 27 196617 + 1;
#P user umenu 153 144 55 196647 1 64 160 1;
#X add op+;
#X add expr;
#P user jit.pwindow 202 341 311 209 0 1 0 0 1 0;
#P toggle 282 52 15 0;
#P message 357 118 29 196617 stop;
#P message 323 118 33 196617 start;
#P newex 323 98 41 196617 sel 1 0;
#P newex 282 75 37 196617 metro;
#P newex 282 140 167 196617 jit.qt.movie 320 240 @autostart 0;
#P message 401 91 76 196617 read bball.mov;
#P user jit.fpsgui 101 334 60 196617 0;
#P newex 203 279 47 196617 gate 1 1;
#P newex 386 208 47 196617 gate 2 1;
#P newex 153 206 47 196617 gate 2 1;
#P newex 240 240 193 196617 jit.expr @inputs 2 @expr "in[0] + in[1]";
#P newex 153 240 64 196617 jit.op @op +;
#P user panel 67 287 128 128;
#X brgb 215 232 220;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 5 0 6 0 208 303 106 303;
#P connect 15 0 16 0;
#P connect 16 0 3 0;
#P connect 3 0 1 0;
#P connect 8 0 3 1;
#P connect 5 0 14 0;
#P fasten 4 0 1 1 391 232 212 232;
#P connect 3 1 2 0;
#P fasten 1 0 5 1 158 268 245 268;
#P connect 2 0 5 1;
#P connect 13 0 9 0;
#P connect 9 0 8 0;
#P fasten 7 0 8 0 406 136 287 136;
#P fasten 11 0 8 0 328 134 287 134;
#P fasten 12 0 8 0 362 134 287 134;
#P fasten 13 0 10 0 287 72 328 72;
#P connect 10 0 11 0;
#P fasten 10 1 12 0 343 116 362 116;
#P connect 8 0 4 1;
#P connect 4 1 2 1;
#P pop;


July 15, 2007 | 2:05 pm

On 15 juil. 07, at 14:53, derrickgiscloux wrote:

> I get worse perfomances with jit.expr than jit.op for a simple
> addition.
> Could someone confirm or explain ?

jit.expr only deals with float 32, jit.op is able to deal with
whatever type you send to. The other point is, no matter what, an
expression evaluator will always be slower than something which
execute the same static code.

ej


July 15, 2007 | 5:40 pm

To be a bit more precise, jit.expr converts all non-float32 matrices to
float32 before running the expression, and then converts back before
output. This conversion is where you lose efficiency. Nonetheless, for
native float32 calculations, jit.expr is surprisingly efficient. In
your case, since you are using char data, your best bet is just to make
a subpatch with cascaded jit.op objects. This will be the most
efficient possible solution.

AB


July 15, 2007 | 8:13 pm

thank you .


Viewing 4 posts - 1 through 4 (of 4 total)