t_symbol simple question

Sep 25, 2013 at 4:25pm

t_symbol simple question

Hi,
I want to make communicate maxmsp to another proprietary software via tcp protocol.
I want to make the protocol as fast as possible between the two like there will be a large quantity of datas and different targeted objects datas sent between the two softwares.

The system will include a management of objects present in max and in the other software, so that max patch will only have to send some message (name of the target object + name of the class + + type of datas + list…).

To optimize the network protocol, i want to convert symbols living in max patches messages (or autopattrs) into value pointers : convert the strings into a unique id int16 or int32 know from the two softwares).

To allow a huge quantity of different pointers (thousands or possibly millions), i would want to avoid a string comparison methods inside my max object.

Is it possible in maxsdk to “scan” a patch, find the messages box attached to my c external, and only compare, i believe, t_symbols pointers to quickly find the id of the message?
Same question asked easier :
Do a message box contain a t_symbol pointer?

If yes, i can compare a “t_symbol” table, it could really lower my cpu usage…

If anyone can only say me where to look for in the sdk doc, it would me nice.

thank you !

#266263
Sep 26, 2013 at 3:46am

Hi,

How to get the text of message boxes: ( https://github.com/nicolasdanet/Flop/blob/master/Sources/Flop/flopMessage.c#L114 ).

Then it’s easy to get t_symbol with the atom_setparse function. If you want to match only the boxes that are connected to your external that is a bit more complex since you have to traverse jpatchlines also.

Anyway have you “measured” efficiency bottlenecks or is it just assumptions ? Take care about premature optimization, and take care to understand well the t_symbol pool mechanisms before going that far in convoluted designs.

My 2 cents.

#266278
Sep 26, 2013 at 4:26am

thank you very much for this informations.

Anyway have you “measured” efficiency bottlenecks or is it just assumptions ? Take care about premature optimization, and take care to understand well the t_symbol pool mechanisms before going that far in convoluted designs.

yes you’re right, i know the danger about premature optimization, but i just thought that,
in my targeted softwares, i use to create manually at least ten or hundred thousand of objects, so i am looking for an efficient way to point as fast as possible to the objects via network without comparing each object’s name one by one by strcomparison method.
Comparing into a int[] pointer is much faster than comparing possibly large string[].

#266282
Sep 26, 2013 at 6:10am

Hi,

To make a “t_symbol / integer” map you can use a t_quickmap ( http://cycling74.com/sdk/MaxSDK-6.0.4/html/group__quickmap.html ).

That’s thread safe (AFAIK). I don’t know if it is efficient for millions entries, but i don’t know if the t_symbol pool itself is not bloated with that!

#266289
Sep 26, 2013 at 6:29am

nice thx a lot, i look at this and will post later if everything goes good.

#266290
Sep 26, 2013 at 6:44am
#266291
Sep 26, 2013 at 6:53am

I am coding an efficient UnityMax communication (and other game engines…protocol) like osc is quite slow, and not really designed in a tcp mind.
Unity can instantiate a huge quantity of objects (you can do it by hand easily too), and the existing “mu” plugin is not well designed (i mean for optimization) in the unity c# part.
In game engines, you manage objects mainly by their name like in 3d editors, typed by hand, or script generated.

#266294

You must be logged in to reply to this topic.