C and lua code profiling! fluctuations

classic Classic list List threaded Threaded
2 messages Options
agostain agostain
Reply | Threaded
Open this post in threaded view
|

C and lua code profiling! fluctuations

Hi guys,

I m currently working on an lpc1769 and I wrote some custom C modules that send over UART (my version supporting rcv buffer). I have a main loop where I process data; send data and execute a simple application. The packet construction and sending is in a C module while the other part of the program is in lua. I profiled each part of my program and I noticed that while the lua application has a constant execution time the other parts(sending and data processing with same data length) have peaks that can go to double as much as the mean execution time.
What can be the cause of that? Is tehre something I might oversee in my module implementation? How can I get somewhat stable execution times? Are there any tricks I could make us of?

thank you in advance ;-)

cheers,

Agostino
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: C and lua code profiling! fluctuations

Hi,

On Mon, Jun 18, 2012 at 10:47 AM, agostain <[hidden email]> wrote:

> Hi guys,
>
> I m currently working on an lpc1769 and I wrote some custom C modules that
> send over UART (my version supporting rcv buffer). I have a main loop where
> I process data; send data and execute a simple application. The packet
> construction and sending is in a C module while the other part of the
> program is in lua. I profiled each part of my program and I noticed that
> while the lua application has a constant execution time the other
> parts(sending and data processing with same data length) have peaks that can
> go to double as much as the mean execution time.
> What can be the cause of that? Is tehre something I might oversee in my
> module implementation? How can I get somewhat stable execution times? Are
> there any tricks I could make us of?

The first thing that comes to mind is "interrupt storm". If there is
an interrupt in yout system that happens lots of times per second,
you'll start noticing slowdowns of the main execution flow at some
point. So you might want to check your interrupt firing rate somehow.
Maybe add a counter to the interrupt handler and print it after a
while, or turn on/off a LED everytime the interrupt executes, stuff
like that.

Best,
Bogdan

>
> thank you in advance ;-)
>
> cheers,
>
> Agostino
>
> --
> View this message in context: http://elua-development.2368040.n2.nabble.com/C-and-lua-code-profiling-fluctuations-tp7577494.html
> Sent from the eLua Development mailing list archive at Nabble.com.
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev