10-27-2017 05:37 PM
I am not sure how good or bad or bad it is. It seems actually good to me and it is about 3 times faster compared to unflatten from string.
On my Lenovo X260 laptop (Windows 7 64-bit, LabVIEW 2014 32-bit, executed in source code with 1 million iterations your code runs for about 0.6 seconds compared to the unflatten form string which takes 1.8 seconds.
10-28-2017 08:23 AM
Could be even faster if you remove the first cast and reverse array. Simply reverse the string and cast to the array of singles.
It surprises me a bit it's faster... Makes me wander if maybe there's constant folding going on...
10-28-2017 09:08 AM
It's not per se bad, but your routine will fail when run on a big endian target. Now you could say that is not a problem since after the demise of PowerPC Macs there is only one LabVIEW platform that uses still big endian binary internally, namely the Power PC based VxWorks realtime targets, which are in maintenance mode too now. Still, LabVIEW has many tools that make it aware of endianess and it's a good idea to make use of them when you can!