Forums > Gen

compared performances of jit.expr and jit.gen

July 21, 2013 | 7:58 am

Hi all,

I have a (probably dumb) question regarding the performances of jit.gen as compared to jit.expr: each time I translate a code from expr to gen, I notice (on my computer at least) a significant degradation of the performances.

As an example, I started from the patch "" provided with the distribution, which indeed shows (using cpuclock) a significant advantage for jit.gen. From this patch, I made two new ones, with a way bigger matrix (1500×1500):

. The patch with jit.expr:

– Pasted Max Patch, click to expand. –


. the patch with git.gen:

– Pasted Max Patch, click to expand. –


The patch with jit.expr takes approx 190% CPU on my machine (Macbook pro i7 4×2.3 GHz, OS 10.8.4, Max 6.1.3), whereas the patch with jit.gen takes more than 450%.

Did I miss something? I’m sure I did, but what?


July 22, 2013 | 2:40 am

On my machine (i5 2.5GHz), i get 270% of CPU for jit.gen and 145% for jit.expr. Using jit.fpsgui, I see above 50 frames per second for jit.gen and barely 12 frames per seconds for jit.expr. So more cpu used, which result in more frames calculated per seconds.

July 22, 2013 | 3:12 am

Hi Emmanuel,

Thanks for the answer, I knew I was missing something :).

OK, this makes totally sense: jit.expr is slower and has a lower cpu limit than jit.gen. So it takes indeed less cpu than jit.gen if we ask him too much, but does not process as fast as it should do. Whereas jit.gen does the job without slowing down the framerate, and even if it’s way more efficient, it asks of course more cpu for that.



July 22, 2013 | 11:12 am

I believe the extra CPU is the result of better taking advantage of multithreading. That’s a good thing.

July 22, 2013 | 11:39 pm

and actually (just to confirm), when I reduce the rate of the qmetro to 20bps, so that jit.expr is able to perform that on time, the opposite appears: jit.gen takes way less CPU than jit.expr.

Thanks for the clarification,


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