summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-22 19:22:49 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-22 19:22:49 +0000
commit2a6e9d9edae6aaf94e643f026cb63774e907cbe6 (patch)
treee49d7f32af29f09bd49bda1c239d467f9c928ec7 /TOOLS
parentb1e0f0b3bde4b9e43372fc51ecc5f5efa47e5380 (diff)
downloadmpv-2a6e9d9edae6aaf94e643f026cb63774e907cbe6.tar.bz2
mpv-2a6e9d9edae6aaf94e643f026cb63774e907cbe6.tar.xz
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
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3077 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/fastmemcpybench.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/TOOLS/fastmemcpybench.c b/TOOLS/fastmemcpybench.c
index dd153a2b75..adedbb7a57 100644
--- a/TOOLS/fastmemcpybench.c
+++ b/TOOLS/fastmemcpybench.c
@@ -95,7 +95,7 @@ static inline unsigned long long int read_tsc( void )
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 @@ int main( void )
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);