Is the frame size 16 bytes? In the first you use 14, in the second 16.
This is slightly faster:
The biggest hurdle is converting the endianness, I do not think you can get much faster with conversion.
I tried to be clever using BLAS dcopy for copying out the relevant part, but the conversion kills the performance gain.
decode-frame-cm.vi
It is actually much faster on my machine. Here are a few results:
@Łukasz
Fast solution: ~30 µs
@cordm
Case 1 (really slow): ~403 µs
Case 2 (good performance and readability): ~54 µs -- output is wrong, see below.
Case 3 (): ~235 µs
Case 4 (original solution): ~30 µs
Case 5 (LV200000_BLASLAPACK.dll): ~14 µs
Case 6 (LVBLAS.dll:BLASCopyVectorH): ~16 µs
-- Windows 11, LabVIEW 2020 SP1 (32-bit)
This code actually truncates the last value because the length of the source array becomes odd.
Here are two possible fixes. The second one is slightly faster for me.
1) Append the final element: ~60 µs. (slightly slower than before)
2) Rotate the string before conversion: ~42 µs.