In Place Element Structure speed - labview

This is a discussion on In Place Element Structure speed - labview ; Hi everyone, This is my first time using this forum.   I like the idea of the In Place Element Structure, and have been thinking of using it in one of my VIs to increase its speed and efficiencty. I've ...

+ Reply to Thread
Results 1 to 3 of 3

In Place Element Structure speed

  1. Default In Place Element Structure speed

    Hi everyone,
    This is my first time using this forum.
     
    I like the idea of the In Place Element Structure, and have been thinking of using it in one of my VIs to increase its speed and efficiencty. I've created a simple VI that will test its speed. It is attached bellow, speed_test.vi.
     
    However, it performs worse than a simple pass by value code. Could someone try this simple test on their PC as well? I may be using it improperly.
     
    Just to note, if the operation is changed from "concatinate" to just "change to upper case/lower case", it still performs the same. As well, I'm running a dual core, so each process takes up 100% of each processor.
     
    Help would be greatly appreciated. Thanks,
     
    -Drazen
     


    speed_test.vi:
    http://forums.ni.com/attachments/ni/.../speed_test.vi

  2. Default Re: In Place Element Structure speed

    Your test is meaningless because:

    - Concatenating a string cannot be done "in place" because the memory footprint is changing.

    - The way you wire things into the inplace structure is also incorrect. You would need to wire your data that should be "in place" via a "inplace In/Inplace out" terminal pair. Right-click to create.

    - In the vast majority of times stuff that can execute in place WILL be executed "in place", even without that structure, so there will be no difference.

    - The inplace structure is a very advanced tool to be used in the very rare case when the compiler needs a hint. This is very rare and also requires you to have deep knowledge of LabVIEW. A good tool to look for problem areas is to "show buffer allocations". If there are no black dots, the inplace is not needed.

    - You have two parallel loops without a wait, meaning each loop will spin many times before releasing the CPU to the other loop. This will also depend on the number of CPUs. If you would place a 0ms wait in each loop, they will more fairly alternate on a single CPU system.

    - Since your sequence frame deals entirely with constant values, it is folded into a constant and no longer processed at runtime. That's why it is faster. It does no do anything! Place the control terminals inside the loop and convert the diagram constants to controls for a fair comparison. You should enable the display of cconstant folding to be more aware of these things.

    - To benchmark, you should use a three-frame sequence with the testing code in the middle frame (Possibly in a loop). Take the tick count in the first and last frame and then subtract them to obtain the code duration. Make sure that all controls and indicators are ouside the sequence, and that nothing can execute in parallel to the sequence. Disable debugging and make sure youre not running any other heavy processes at the same time.

     

  3. Default Re: In Place Element Structure speed

    Hi altenbach,
    thanks for the reply. You're correct, I've made a few errors. It seems that resolving the folding has done it. I've placed two controls, one inside each while loop and had them run through the structures, containing the same data. It seems that the In-Place structure is 2% faster in this case. You can take a look at my vi here. The wiring was just a mistake I didn't save in the file.
     
    Thanks,


    speed_test.vi:
    http://forums.ni.com/attachments/ni/.../speed_test.vi

+ Reply to Thread

Similar Threads

  1. Replies: 0
    Last Post: 10-15-2007, 03:40 PM
  2. Re: Removing border nodes in the In Place Element Structure
    By Application Development in forum labview
    Replies: 0
    Last Post: 09-27-2007, 09:10 AM
  3. Re: one element array as name of structure typedef
    By Application Development in forum C
    Replies: 0
    Last Post: 09-21-2007, 12:13 AM
  4. How do I place an attribute within the element of a soap header?
    By Application Development in forum XML SOAP
    Replies: 0
    Last Post: 05-08-2007, 11:27 AM
  5. Structure view element icon does not produce structure
    By Application Development in forum Adobe Framemaker
    Replies: 6
    Last Post: 12-05-2006, 11:24 AM