From 5fbe018d06951bc30441cd0779cb782bdc18b836 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 7 Jun 2010 14:39:08 -0700 Subject: [PATCH] tests: improve memcpy_speed --- testsuite/memcpy_speed.c | 70 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 11 deletions(-) diff --git a/testsuite/memcpy_speed.c b/testsuite/memcpy_speed.c index 77b1849..8bf17f2 100644 --- a/testsuite/memcpy_speed.c +++ b/testsuite/memcpy_speed.c @@ -2,60 +2,108 @@ #include #include #include +#include +#include #include #include #include + #define ALIGN(ptr,n) ((void *)((unsigned long)(ptr) & (~(unsigned long)(n-1)))) int main(int argc, char *argv[]) { char *s, *d; - uint32_t *src, *dest; + uint8_t *src, *dest; OrcProfile prof; + OrcProfile prof_libc; double ave, std; + double ave_libc, std_libc; + double null; int i,j; double cpufreq; + //const uint8_t zero = 0; orc_init (); - cpufreq = 1000e6; + //cpufreq = 2333e6; + cpufreq = 1; s = malloc(1024*1024*64+1024); d = malloc(1024*1024*64+1024); - src = ALIGN(s,128); + src = ALIGN(s,128) + 1; dest = ALIGN(d,128); - printf("orc_memset:\n"); + orc_profile_init (&prof); + for(j=0;j<10;j++){ + orc_profile_start(&prof); + orc_profile_stop(&prof); + } + orc_profile_get_ave_std (&prof, &null, &std); + +#if 0 + // printf("orc_memset:\n"); for(i=10;i<26;i++){ orc_profile_init (&prof); + orc_profile_init (&prof_libc); for(j=0;j<10;j++){ orc_profile_start(&prof); orc_memset (dest, 0, 1<