[dpdk-dev] Issues on prefetch function

Jim Jia mydpdk at 126.com
Sun Sep 29 08:03:44 CEST 2013


Hello, everyone
         I'm doing an experiment to test the performance of rte_prefetch0. I find the speed of that function is quit slow.  When executing the following code, tit will take about 8,000,000 cycles (about 45 cycles each loop ). What's wrong with it?

      Thanks in advance.
    

 struct A
{
  char a[64];
};

struct A foo[180000];


int
main ()
{
  int i, j;

  long long a = rte_rdtsc ();
  for (j = 0; j < 180000; j++)
    {
      rte_prefetcht0 (&foo[j]);
    }
  long long b = rte_rdtsc ();
  printf ("%lld\n", b - a);
  return 0;
}



More information about the dev mailing list