LabVIEW Development Best Practices Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Specification Pattern caveat/alternative

User komorbela posted some useful alternative information about the Specification Pattern.  To avoid confusion in the main post, since the attachments are not examples for implementing the specification pattern but are instead a benchmark for comparing that pattern with alternative implementations, the attachments have been moved to this thread.

Komorbela said:

"A note for the ones who have a very fast system that is at the limit of the hardware it runs on:

When considering replacing cases in case structures with dynamic dispatch VIs the small overhead of dynamic dispatch can be an issue.

Here is the fact: calling the dynamic dispatch VI that belongs to the actual class is done in dynamically as the code runs. It necessary means there is some overhead (time punishment) while deciding which VI to call. At least this is the case in LabVIEW.

So before jumping into a refactoring of old running code make a small test to compare case selection vs. dynamic dispatch."

Download All
Message 1 of 5
(7,753 Views)

It's strange that the 2012 version is faster then the 2013 version over all.

For dynamic dipsaptch about 5% faster, or is it just my computer?

0 Kudos
Message 2 of 5
(4,474 Views)

LabVIEW 2012 / LabVIEW 2013

time duration ratios:

0.91 - Dynamic dispatch

0.95 - Cast and Dynamic dispatch

0.99 - Cast and Static dispatch

1.04 - Cast and Static dispatch Inlined

So yes, dynamic dispatch is slower in Lv2013 at me also. Only the inlined static dispatch is faster in Lv2013

0 Kudos
Message 3 of 5
(4,474 Views)

Forum post by NI R&D confirming that dynamic dispatch is slightly slower in 2013 than 2012:

http://forums.ni.com/t5/LabVIEW/Big-Performance-Degradation-in-LabVIEW-2012/m-p/2699881#M801792

Message 50 in that thread.

Message 4 of 5
(4,474 Views)

I am pleased to hear that! Good to know this problem is on the radar at NI

0 Kudos
Message 5 of 5
(4,474 Views)