Forums > MaxMSP

msg vs int/float

June 13, 2012 | 11:46 pm

To briefly (I promise! :)) go back to my complaints about strict typing

Is there an advantage to be had by using int/float vs msg? Their function (as a local variable) is mechanically and structurally identical – you plugs your value in the right inlet and your bang in the left, and your msg with an $variable into the outlet. Surely if static typing exists for any reason other than reverse compatibility int/float would provide nontrivial performance gains?

Many thanks in advance


June 14, 2012 | 4:14 pm

the biggest problem is converting types, so always use that what you will need on the other end.


June 16, 2012 | 7:02 pm

nicolas; re my original question, ty, I have no idea how I missed the display part of msg (insufficient sleep :)).

re profiling, its still a cool trick.

A) why is it useless for real work?

B)which code profiler do you recommend?

Thanks again

joe


June 17, 2012 | 7:27 am

One of the biggest wins for fixed types is that you know how big they are. A message have (fairly) arbitrary lengths, and have to be parsed.

This is a simple test to illustrate some of the cost:

– Pasted Max Patch, click to expand. –

June 17, 2012 | 4:33 pm

chris, another excellent point. See, I can be reasonable if you give me an argument :).


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