> I have a question about performance. I created a VI that creates > some dummy waveforms, does some processing to them, and displays the > results. Pretty basic. I decided to simplify the Vi by putting all of > the processing algorithms into a sub vi. When I did this the VI slowed > down significantly. Like about five to ten times. The code in the sub > VI is exactly the same as when it was just lying in the top level vi. > I even saved two versions and compared them. The processing is some > FFTs and a little complex math, but I don't see how that is important. > Does anybody have an explaination as to why I am experiencing such a > drastic slow down? and maybe how to deal with it without keeping my > code on the top level. Any help would be gladly appreciated. Thanks in > advance. >
I looked into it and I can sort of explain it, to myself. I'll bounce this off some others at work tomorrow so that I can explain it better. In a nutshell, the time isn't being spent executing the subVI. By using the profiler, and letting both VIs run about five seconds, the single subVI solution accounts for about five seconds, and much of the time is spent in the top level diagram. In fact, the case statement is only executed about 100 times. When I run the subVI edition for about five seconds, there is some missing time. The time spent in the VI is something like 1.5 seconds including the time spent in the subVI. Indeed, the VI did run slower, because it spent most of its time waiting for LV to schedule it. At least that is my theory. I played around a bit and figured out something that makes the subVI version runs the same speed. I'll check back tomorrow. Greg McKaskle
