Tim_S Posted September 10, 2014 Report Share Posted September 10, 2014 Posted for the next person to run into this (it could always be me!). Backstory: I was testing performance of some RT code and it was coming out lousy. I tracked the slow performance down to where I was reading and writing a linear buffer in a VI. The write was taking 88 msec and the read was taking over 300 msec. I brought the code over to Windows side and was getting pretty bad performance there (write was 1 msec). [Omit lots of head scratching, improvement attempts, call to NI tech support, obligatory waving of dead chicken...] There were two things that improved the performance: 1. Eliminating the bundle/unbundle of cluster elements 2. Wiring through case structures There is some cost hit with the bundle/unbundle. I didn't determine how much improvement eliminating them created. My solution was to eliminate my cluster and use a shift register for each element of the cluster. Tech support came up with using the in place element structure. Wiring through the case structure created the best benefit for me. Tech support was able to relate about the case structure and memory allocation, "The compiler is going to create duplicate copies of the array when branching and when going into a case structure to make sure that we operate on good array data every time (regardless of which case is executed)..." My test code was branching a 1M element U32 array, so I was getting a serious performance hit from the copy. This copy does not show up when using the Show Buffer Allocations tool (LV 2012). Tech support was able to identify the allocation using the Desktop Execution Trace Toolkit. All said-and-done, the relative performance on a Win7-64 with LV2012-32: Original: 1046 usec Using IPE: 31 usec Using shift registers: 26 usec Tech support organized the back-and-forth and sent a project demonstrating the difference; I've included that. Buffer Testing Project.zip Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.