[Mplayer-cvslog] CVS: main/TOOLS fastmemcpybench.c,1.3,1.4

Nick Kurshev nickols_k at mail.ru
Fri Nov 23 08:55:25 CET 2001


Hello, Michael!

On Thu, 22 Nov 2001 20:22:51 +0100 you wrote:

> Update of /cvsroot/mplayer/main/TOOLS
> In directory mplayer:/var/tmp.root/cvs-serv7865
> 
> Modified Files:
> 	fastmemcpybench.c 
> Log Message:
> newly allocated memory seems to point to only 1 zero filled 4k page or something so there is a near 100% cache hit rate ... not very realistic, writeing something in the source array fixes that so the benchmark scores are meaningfull now
> 
> 
> Index: fastmemcpybench.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/TOOLS/fastmemcpybench.c,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -r1.3 -r1.4
> --- fastmemcpybench.c	2 May 2001 14:48:35 -0000	1.3
> +++ fastmemcpybench.c	22 Nov 2001 19:22:49 -0000	1.4
> @@ -95,7 +95,7 @@
>    return retval;
>  }
>  
> -unsigned char arr1[ARR_SIZE],arr2[ARR_SIZE];
> +unsigned char  __attribute__((aligned(4096)))arr1[ARR_SIZE],arr2[ARR_SIZE];
>  
>  int main( void )
>  {
> @@ -107,9 +107,12 @@
>    mga_init();
>    marr1 = &frame[3];
>  #else
> -  marr1 = &arr1[3];
> +  marr1 = &arr1[0];
>  #endif
> -  marr2 = &arr2[9];
> +  marr2 = &arr2[0];
> +
> +  for(i=0; i<ARR_SIZE; i++) marr1[i] = marr2[i] = i;
> +
>    t=GetTimer();
>    v1 = read_tsc();
>    for(i=0;i<100;i++) memcpy(marr1,marr2,ARR_SIZE-16);
> 
What IS IT?
This test was designed by me for testing copying of misaligned data but now
they are aligned on 4096 byte boundary???

Please reverse this changes.

Best regards! Nick



More information about the MPlayer-cvslog mailing list