08-08-2016 12:22 PM
I have an issue with processing time of the attached code. The code is developed to change the font color of a text input as needed. The ColorText.vi is the VI I am having troubles optimizing for speed. The Main.vi is for test purposes only. As it stands now the VI takes about 14 seconds on my PC but there must be some improvements that can be made to speed that up. Any feedback would be greatly appreciated.
08-08-2016 01:33 PM
I think you're out of luck optimizing the text colorizing loop. You might make more progress reworking your For loop to colorize larger sections at a time, rather than single lines. It also appears that you could do a single For loop rather than two, and do you really need to convert your string to an array and then back to a string again, rather than using the string you start with?
08-08-2016 01:45 PM
Try
after the defer FP updat
drop a string control property node visable with a false.
After the loop that does the color setting use a another visable to make it visable just prior the the undefer.
Ben
08-08-2016 02:11 PM
Alos getting rid of the indicator in the sub-VI and it's property node stuff will help as well.
Ben
08-09-2016 07:10 AM
Thanks for the input, I have tried making the string control not visible during the processing but that did not help reduce the time. If I set the “Update String Indicator” to false it does speed up the time which is essentially removing the indicators property node stuff. I was hoping there was some glaring issue with the rest of the code that could be optimized. I suppose I should re-write the function with only one for loop instead of processing with two. Thanks for the feedback.
08-09-2016 07:37 AM
The execution trace toolkit would let you peak behind the curtain but I suspect the bulk of the time is working in the UI thread.
Ben