[Mplayer-cvslog] CVS: main/TOOLS fastmemcpybench.c,1.3,1.4
Michael Niedermayer
michael at mplayer.dev.hu
Thu Nov 22 20:22:51 CET 2001
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);
More information about the MPlayer-cvslog
mailing list