11-06-2006 03:08 AM
11-07-2006 02:16 PM
Hello,
It sounds like an interesting problem. It would be worth some experimentation to figure out what's going wrong - attempting to decouple major "pieces" of the code would be helpful. For example, you could try breaking your code into multiple loops if that makes sense in your architecture, but perhaps you could even eliminate all but one of the loops to begin with, and see if you can correlate the problem to the code in just one of your loops.
Another concern is that you mention using many local variables. Variable read operations cause new buffer allocations, so if you're passing arrays around that way, you could be hitting a problem of forcing your machine to perform many allocations and deallocations of memory. As arrays grow, this can be a bigger and bigger problem. You can use other techniques for passing data around your block diagram, such as dataflow if possible (just simple wires), or queues where dataflow can't dicatate program flow completely.
Hopefully looking into your code with the above considerations will lead you in the right direction. In your case, removing code so that you can identify which elements are causing the problem should help significantly.
Best Regards,
JLS
11-08-2006 08:58 AM
I'll just elaborate slightly on a point that JLS made. To me the most likely culprit sounds like an array that is increasing in size. Many array operations' time to execute is proportional to the size of the array. This also applies to data copies, which can be an issue if lots of local variables are in use. Use of functions like "Build Array", "Insert Into Array", etc, particularly inside the loop where you're concatenating on to an existing array using a shift register would be a big red flag.
Similar, but easy to overlook are some string operations. String concatenation and then processing of the resulting string is very much like a growing array.
There may be other good explanations for the behavior that I'm not thinking of, but this is where I'd start.
Good luck!