uludaggonul / snow-dots

Automatically exported from code.google.com/p/snow-dots
0 stars 0 forks source link

primitiveToString bottleneck #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Concatenating char arrays to make padded strings is the bottleneck.  Can I do 
better by allocating up front? Why wouldn't cat do this already?

Original issue reported on code.google.com by Benjamin.Heasly on 29 Jan 2010 at 5:35

GoogleCodeExporter commented 8 years ago
I tried hard to tighten up primitiveToString.  While I was able to improve 
performance, the floor for m-code still seemed pretty high.

So I replaced matlabUDP with matUDPMxGram, which uses the same socket 
organization.  But instead of accepting Matlab strings, it accepts various 
Matlab types 
including double, char, logical, cell and struct, and serializes them in the C 
code.

As of r53, this has proved much faster and more flexible, and removes the need 
for 
stringification. 

Original comment by Benjamin.Heasly on 16 Feb 2010 at 10:41