mirror of https://github.com/mpv-player/mpv
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
This commit is contained in:
parent
b1e0f0b3bd
commit
2a6e9d9eda
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue