compared performances of jit.expr and jit.gen

Alexis Baskind's icon

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 "bench.compare.expr.maxpat" 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 (1500x1500):

Max Patch
Copy patch and select New From Clipboard in Max.

. The patch with jit.expr:

Max Patch
Copy patch and select New From Clipboard in Max.

. the patch with git.gen:

The patch with jit.expr takes approx 190% CPU on my machine (Macbook pro i7 4x2.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?

Alexis

Emmanuel Jourdan's icon

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.

Alexis Baskind's icon

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.

Cheers,

Alexis

Joshua Kit Clayton's icon

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

Alexis Baskind's icon

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,

Alexis