06-14-2013 02:53 AM
If you already know that your events structure is the culprit, one thing you could try to do is minimize amount of things you do inside an events structure (if you're familiar with C/C++/C#/etc traditional languages, best practice is to do take care of interrupts as quickly as possible - I'm meaning to imply the same concept here for events structure). Less you do in an events structure, better the performance is - I even avoid any front-panel updates (such as manipulation of visible property) or time-consuming items like string manipulations/etc inside an events structure.
-DP
06-14-2013 02:59 AM
I appreciate the input but:
1) My "problematic" event structure is the CONSUMER loop in my producer consumer design. It is dealing exclusively with user events. UI Events (to which you are referring as Interrupts) are handled in a seperate loop which does approx. zero actual work. Yeah, I have two different loops with event structures and no, I share no events between them (Unless you include "Timeout").
2) My problem isn't with execution, performance is fine. The question I have is the "code complexity" being shown by LV 2012.
Shane.
06-14-2013 03:59 AM
You did not understand my point - I was referring to usage of "event structure" itself, irrespective of which loop it was in. Reference to interrupts was simply an analogy (hence "meaning to imply the same concept"), to convey that code complexity seems to be affected by how / how much code you implement inside event structures versus using other (non event structure) methods as much as possible - a part of caveats when using event structures.
Anyway, good luck.
-DP
06-14-2013 04:44 AM
And my counter-question would be why would it make any difference whatsoever if you have an event structure or simply a while loop with a queue. The complexity is essentially the same.
If you mean simply doing less in loops, then yeah, that's kind of obvious that that'll impact complexity. Whether the main loop feature is an event structure or not makes no difference for me.
06-14-2013 04:55 AM
BTC_admin wrote:Less you do in an events structure, better the performance is - I even avoid any front-panel updates (such as manipulation of visible property) or time-consuming items like string manipulations/etc inside an events structure.
Execution speed is not very closely correlated with complexity. Some very simple code could be very slow and some very compelx code could be very fast.
06-14-2013 06:41 AM
These numbers wouldn't bother me at all. Most of your "complexity" and increased memory usage is coming from the newer version of LV you are using. A lot has been stuffed "under the hood" since version 7.1.
06-14-2013 08:28 AM
I could accept that no problem if the comparison in size wasn't made in the SAME LV version. Sure, the origins of the VI are way back in 7.1, but the numbers I'm comparing are both in LV 2012.
06-14-2013 09:10 AM
06-14-2013 11:03 AM
Well it's a problem in that it takes more memory and time to compile. We're already at times at the limit of what a 32-bit machine can compile to be honest, so I was hoping to be able to reduce complexity a little to help ease the pain. Apparently it won't help because I tried pasting into a new VI, same story.
I understand that the measure of complexity is a number generated by the compiler based on what it can easily and less easily optimise. As such, reducing complexity should make for a more painless compile experience.
06-15-2013 01:32 PM
I can't answer the question, since I never looked into the exact details on code complexity (although I believe there are fairly detailed articles on the topic elsewhere on this site), but if your problem is with compile times, you could consider lowering (or is it raising? Read the docs) the optimization slider in the 2012 options, which I understand makes its decision based on the code complexity metric. The tradeoff is that the performance might suffer.
Another option might be to farm out the compilation to a dedicated server (either your own or I think NI provides this as a service, although I don't know if that only applies to FPGA. You could also try asking Jack Dunaway who demonstrated working on Amazon's remote machines).