Gen *can* result in better performance than using MSP objects, but this can’t be guaranteed in all cases. In general, Gen patchers start to show better performance compared to MSP patching as the number of objects and connections increases. Not only does this amortize the unavoidable overhead of the gen~ object itself, it also allows for much greater compiler optimization within the patch (which simply isn’t possible for MSP patchers).
I have attached a performance testing patch which creates 20 copies of a particular operator, and connects them up randomly. It then generates both MSP and gen~ versions, and alternately hosts them in a poly~ with 32 voices.
The results clearly show that for many operators the difference is quite significant even with only 20 boxes, but some operators have similar performance and a few (here trunc and mod) are worse.
We are focusing efforts to improve these particular operators for the 6.0.7 release, however over the last few months we have been making major changes to the internals of Gen, and have been balancing the importance of performance improvements with the addition of major user-requested features.
: nothing.maxpat: avg 0. max 1.
: test_empty_gen.maxpat: avg 0.8 max 1.
: test_add_gen.maxpat: avg 2. max 4.
: test_cos_gen.maxpat: avg 25.3 max 37.
: test_delay_gen.maxpat: avg 22.1 max 31.
: test_delta_gen.maxpat: avg 4.1 max 8.
: test_div2_gen.maxpat: avg 2. max 3.
: test_div_gen.maxpat: avg 21.6 max 33.
: test_gate_gen.maxpat: avg 4.2 max 7.
: test_log_gen.maxpat: avg 30.3 max 43.
: test_maximum_gen.maxpat: avg 1.9 max 5.
: test_mod_gen.maxpat: avg 61.1 max 95.
: test_mul_gen.maxpat: avg 2.1 max 4.
: test_noise_gen.maxpat: avg 6.5 max 11.
: test_phasewrap_gen.maxpat: avg 12.5 max 19.
: test_poltocar_gen.maxpat: avg 21.7 max 32.
: test_sqrt_gen.maxpat: avg 3.2 max 6.
: test_trunc_gen.maxpat: avg 17.9 max 26.
Tested with Max 6.0.5 (1741622)
May 22, 2012 at 3:56pm #229327