This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5718: For loop taking much time

Part Number: AM5718

Tool/software: Linux

Dear All,

We are using the latest sdk for AM5718 soc. we used for loop in our Application code as per our analysis by below code it will took more time for execution.

Here is the code for 13M time for loop is executing and it will took 116 ms.

#include <stdio.h>
#include <sys/time.h>
float timedifference_msec(struct timeval t0, struct timeval t1)
{
return (t1.tv_sec - t0.tv_sec) * 1000.0f + (t1.tv_usec - t0.tv_usec) / 1000.0f;
}
int main()
{
struct timeval t0;
struct timeval t1;
float elapsed;
int i=0;
gettimeofday(&t0, 0);
for(i=0;i<13*1024*1024;i++);
gettimeofday(&t1, 0);
elapsed = timedifference_msec(t0, t1);
printf("bayer_to_rgb in %f milliseconds.\n", elapsed);

}

do anyone help us for how to making it fast means same for loop will took less time?

Thanks & Best Regards,

Nikunj Patel

  • Hi Nikunj,

    Do you have the result of the similar test on other platforms (similar ARM processor with same kernel and libc version) to confirm it runs slowly on AM5718?
  • Dear Bin liu,

    We tested on 800 Mhz cpu (imx6ull) and it will took 142 millisecond so i am little bit worry why our CPU (1.5 Ghz) took this much time.

    did we need to change any configuration ?

    Thanks & Best Regards,
    Nikunj Patel

  • Nikunj,

    The performance of this look is going to vary dramatically based on the load on the system due primarily to Linux scheduling. I'm assuming you were running two different Linux builds on the two different processors and that probably accounts for the differences in the time.

    If you want to minimize the time spent on this loop, you will need to work with the scheduler to give this process more priority or more time, or reduce the other things running in the system. This is a generic Linux optimization task and we can't really provide more specifics as part of our support.

    I hope this is helpful to you.
  • Dear Ronb,

    can you just test above our example on your ti development board of am5718 soc?

    Thanks & Best Regards,
    Nikunj Patel
  • Nikunj,

    There are so many variables to account for for this kind of testing, that I don't believe it to be fruitful. For example, you haven't told us for either test what kind of memory you were running from or how you had managed that. That one variable can dramatically change a test like this. DDR can be another big variable, along with a number of other system related issues. The daemons that are loaded and executed. These are just to name a few.

    We provide standard benchmarks on our products here. These are standard gauges of a processor's performance that can be more directly compared.

  • Thanks,

    I want to know that my board have does not issue with hardware. so i just asking for doing same test on any AM5718 eval board because right now we does not have eval board.

    Thanks & Best Regards,
    Nikunj Patel
  • Nikunj Patel,

    That's why I recommended you look at some of the other standard benchmarks that we publish. You can run one of these benchmarks on your board and see if the result is similar (or at least scales) with what we publish on ours. I believe this would be a much more reliable way to achieve the goal you are trying to achieve.