NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sequence takes 10x more time to execute when launched from ProcessModel/ProcessModel Plugin

Solved!
Go to solution

Hi all,

 

I'm facing a weird issue with a sequence a made.

This sequence is used to script a new sequence file according to data taken into a database. This sequence works perfectly fine.

When I execute it only calling the MainSequence callback (no processmodel) it executes in # 3 seconds.

 

I then included it in my process model (parallel process model) to be launched just before the main sequence callback in each testsocket. There it executes in # 27 seconds !!!

I then tried to use the process model plugins so I made an addon and called this sequence (seqcall MainSequence in Scripter.seq => the code is in its own file)  in ModelPlugin - PreUUT. Same result, #27 seconds !!

 

As my development is part of a TS GUI made in LabVIEW I inserted PostUIMessage steps in this sequence to try to determine which steps takes longer to execute.

It appears that it's the piece of code setting the values of freshly created seqcalls (sometimes more than 1.5 seconds to do this) !! (see sequence attached, Main step group only ; Setup step group contains previous step just to give a 'context' to what happens here).

What this code do is :

  • Create a new sequence in a sequence file (setup)
  • Get a list of variables (array of container containing the lookup string, value and type of a vraiable) taken from my database (other part of code)
  • Create and initialize value of parameters in this new sequence according to the list of variables (Main Step Group ; takes long !)

 

Any idea on what happens here ? How can I speed everything up ?

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 1 of 19
(4,243 Views)

I assume that the 3 second case, you are only generating one file, but in the model case, you are generating a file per socket. How many sockets? How many cores on your machine?

0 Kudos
Message 2 of 19
(4,241 Views)

Hi James !

Only 2 test sockets.

And the generation time is still #27 seconds if I only execute 1 test socket. So the number of testsocket is not influencing that much the generation.

 

My machine is a 8 core intel i7, running Win7 32 bits, TS 2012 SP1.

 

---BTW, I updated my first post. The example file changed (I first uploaded the wrong one)

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 3 of 19
(4,239 Views)

The file you attached doesn't run standalone, so I couldn't try it. What time do you get for just one socket?  You might need to put some timing statements in your sequence to further isolate where the slow down is.

 

One minor optimization would be to disable result collection in these sequences. However, for the magnitude of the slowdown you are seeing, that won't make a difference.

0 Kudos
Message 4 of 19
(4,229 Views)

Hi James,

 

This sequence is just part of a big sequence hardly related to a database. So I can't send you something that just runs.

Steps in the sequence file I sent are the steps taking a long time to execute according to my bench. So it would be pretty easy for you to reconstruct a sequence file that runs based on this sequence file example.

 

For one socket it's something like #25 seonds, two sockets #27 seconds.

 

Result and tracing are both disabled.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 5 of 19
(4,225 Views)

I'm not in support, so I can only work on questions in my spare time. I'm not sure when I would be able to rewrite the sequence to run standalone. What I was trying to find out was if the time was evenly distributed among those steps or if the slow down could be attributed to one or two in particular. If so, it might provide a clue as to the underlying issue.

0 Kudos
Message 6 of 19
(4,222 Views)

I'll modify my sequence to add a UIMessage between each step and see which one takes longer to execute.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 7 of 19
(4,220 Views)

It might be easier and more accurate to put

 

   Locals.Time = Seconds()

 

as the pre-expression (using multi select editing) and

 

   Locals.TimeOutput += Step.Name  + ": " + Str(Seconds() - Locals.Time) + "\n"

 

as the post expression. Then you could breakpoint or use a message popup to view the locals.TimeOutput string

0 Kudos
Message 8 of 19
(4,217 Views)

Hi James,

 

I made a new test.

It looks like that what's taking time is leaving the seqcall and looping in the for each that takes sometimes more than 350ms ! The code inside the subsequence doesn't take that much time to execute.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 9 of 19
(4,206 Views)

Are you passing a large number of parameters or a large data structure by value (i.e. making a copy on each call)?

 

-Doug

0 Kudos
Message 10 of 19
(4,197 Views)