diff --git a/benchmarks/BenchOps/BenchOps.cpp b/benchmarks/BenchOps/BenchOps.cpp index 044c929bf..fe44e4a4c 100644 --- a/benchmarks/BenchOps/BenchOps.cpp +++ b/benchmarks/BenchOps/BenchOps.cpp @@ -6,11 +6,13 @@ Atomic val; struct Data { int64 val[4]; + + void Zero() { val[0] = val[1] = val[2] = val[3] = 0; } }; Data src[16], dst[16]; -#define N 100000000 +#define N 10000000 CONSOLE_APP_MAIN { @@ -66,12 +68,31 @@ CONSOLE_APP_MAIN free(malloc(3000)); } } + { + RTIMING("Zero32"); + for(int i = 0; i < N; i++) { + dst[i & 15].Zero(); + } + } { RTIMING("Copy32"); for(int i = 0; i < N; i++) { dst[i & 15] = src[i & 15]; } } + int cnt = max((int)Random(10), 32); + { + RTIMING("memcpy variable 32"); + for(int i = 0; i < N; i++) { + memcpy(&dst[i & 15], &src[i & 15], cnt); + } + } + { + RTIMING("memcpy fixed 32"); + for(int i = 0; i < N; i++) { + memcpy(&dst[i & 15], &src[i & 15], 32); + } + } { RTIMING("Copy64"); for(int i = 0; i < N; i++) { diff --git a/benchmarks/BenchOps/BenchOps.upp b/benchmarks/BenchOps/BenchOps.upp index 8c27336fc..7f14d1880 100644 --- a/benchmarks/BenchOps/BenchOps.upp +++ b/benchmarks/BenchOps/BenchOps.upp @@ -5,5 +5,5 @@ file BenchOps.cpp; mainconfig - "" = ""; + "" = "MT"; diff --git a/benchmarks/BenchOps/init b/benchmarks/BenchOps/init new file mode 100644 index 000000000..53511c89e --- /dev/null +++ b/benchmarks/BenchOps/init @@ -0,0 +1,4 @@ +#ifndef _BenchOps_icpp_init_stub +#define _BenchOps_icpp_init_stub +#include "Core/init" +#endif