08-01-2013 10:32 AM - edited 08-01-2013 10:46 AM
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 :
Any idea on what happens here ? How can I speed everything up ?
Solved! Go to Solution.
08-01-2013 10:42 AM
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?
08-01-2013 10:49 AM - edited 08-01-2013 10:50 AM
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)
08-01-2013 11:03 AM
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.
08-01-2013 11:43 AM
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.
08-01-2013 12:06 PM
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.
08-01-2013 12:10 PM
I'll modify my sequence to add a UIMessage between each step and see which one takes longer to execute.
08-01-2013 12:28 PM
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
08-02-2013 05:24 AM
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.
08-02-2013 09:30 AM
Are you passing a large number of parameters or a large data structure by value (i.e. making a copy on each call)?
-Doug