LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execution speed for 15000 lines of c code

Hello,

 

I have a .dll that is equivalent to about 15,000 lines to c code. If LabView were to call this .dll, how much time (msec) would it take to run that piece of code?

 

My computer spec:

Intel Pentium Dual CPU

E2180 @ 2.00GHz

1Gb Ram

Windows XP SP2

LabView 8.6

TestStand 4.1.1

0 Kudos
Message 1 of 14
(3,184 Views)

Between 0 and infinity

Message 2 of 14
(3,176 Views)

it would probably take about the same time as it would take to run the same code natively in C. 😉

 

What does the code do? How big are the data structures involved?

Message 3 of 14
(3,175 Views)

The code is a plant model of a car engine. It runs under 10ms per step when I run it in as an executable of compiled c.

0 Kudos
Message 4 of 14
(3,157 Views)

@Bladhart wrote:

The code is a plant model of a car engine. It runs under 10ms per step when I run it in as an executable of compiled c.


To keep with the car idea...that's like asking its 10 miles to my destination, how long will it take me to drive there? Well it depends on traffic, stop lights, the speed you drive at etc. However long the 15,000 lines takes to execute standalone, it will take that long in LabVIEW, plus maybe a little bit of overhead for calling the dll.

0 Kudos
Message 5 of 14
(3,150 Views)

What is a "Step"?

0 Kudos
Message 6 of 14
(3,149 Views)

Oh, a "step" is one execution of the model, or one loop.

0 Kudos
Message 7 of 14
(3,126 Views)

You do realize that no one can really answer your question. The best we could say is that the performance will be virtually the same as if called from a C program. However as with any code you can write very efficient code or very inefficient code.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 14
(3,104 Views)

 


Bladhart wrote:

I have a .dll that is equivalent to about 15,000 lines to c code. If LabView were to call this .dll, how much time (msec) would it take to run that piece of code?

 

My computer spec:

Intel Pentium Dual CPU

E2180 @ 2.00GHz

1Gb Ram

Windows XP SP2

LabView 8.6

TestStand 4.1.1


 

Let's back up to the beginning. 90% of your information is completely irrelevant:

 

 

  • There is no correlation between number of code lines and execution speed. I probably could write a 5-liner that takes forever and 100000 liner that completes immediately. 😄
  • The hardware information is irrelevant, because the C and LabVIEW versions will scale equally as a function of processor.
  •  Since you have two cores, you might be able to call the dll code twice in parallel when using LabVIEW, thus doubling the throughput if this is a repetitive operation. (make a second copy of the dll under a new name to avoid possible conflicts).
Why do you even ask all this? In the time it took you to ask the question, you could have written the LabVIEW code and benchmarked it yourself. Is there anything that prevents you from doing this? You said you have LabVIEW, right?

 

Message 9 of 14
(3,086 Views)

Answer: Very close to the same time as if you called the DLL from a c-program.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 14
(3,067 Views)