2 Copyright © 2008, The AROS Development Team. All rights reserved.
11 #define BUFSIZE 1000000UL
15 #define BENCHMARK(z, n, c) memcpy(dst, src, BUFSIZE);
16 BENCHMARK_BUFFER(memcpy
,1000, BUFSIZE
);
19 #define BENCHMARK(z, n, c) memmove(dst, src, BUFSIZE);
20 BENCHMARK_BUFFER(memmove
,1000, BUFSIZE
);
23 #define BENCHMARK(z, n, c) int res ## n = memcmp(dst, src, BUFSIZE); res ## n = 0;
24 memset(src
, 'a', BUFSIZE
);
25 memset(dst
, 'a', BUFSIZE
);
26 BENCHMARK_BUFFER(memcmp
,1000, BUFSIZE
);
29 #define BENCHMARK(z, n, c) char *res ## n = memchr(dst, 'b', BUFSIZE); res ## n = NULL;
30 memset(src
, 'a', BUFSIZE
);
31 BENCHMARK_BUFFER(memchr
,1000, BUFSIZE
);
34 #define BENCHMARK(z, n, c) memset(dst, 'b', BUFSIZE);
35 BENCHMARK_BUFFER(memset
,1000, BUFSIZE
);
38 #define BENCHMARK(z, n, c) int res ## n = strlen(dst); res ## n = 0;
39 memset(dst
, 'a', BUFSIZE
);
40 dst
[BUFSIZE
- 1] = '\0';
41 BENCHMARK_BUFFER(strlen
,1000, BUFSIZE
);
44 #define BENCHMARK(z, n, c) strncpy(dst, src, BUFSIZE);
45 memset(src
, 'a', BUFSIZE
);
46 memset(dst
, 'a', BUFSIZE
);
47 BENCHMARK_BUFFER(strncpy
,1000, BUFSIZE
);
50 #define BENCHMARK(z, n, c) int res ## n = strncmp(dst, src, BUFSIZE); res ## n = 0;
51 memset(src
, 'a', BUFSIZE
);
52 memset(dst
, 'a', BUFSIZE
);
53 BENCHMARK_BUFFER(strncmp
,1000, BUFSIZE
);
56 #define BENCHMARK(z, n, c) int res ## n = strncasecmp(dst, src, BUFSIZE); res ## n = 0;
57 memset(src
, 'a', BUFSIZE
);
58 memset(dst
, 'A', BUFSIZE
);
59 BENCHMARK_BUFFER(strncasecmp
,1000, BUFSIZE
);