.benchmarks

git-svn-id: svn://ultimatepp.org/upp/trunk@9479 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2016-02-14 08:05:56 +00:00
parent dd94cb4c34
commit 06aea21228
3 changed files with 27 additions and 2 deletions

View file

@ -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++) {

View file

@ -5,5 +5,5 @@ file
BenchOps.cpp;
mainconfig
"" = "";
"" = "MT";

4
benchmarks/BenchOps/init Normal file
View file

@ -0,0 +1,4 @@
#ifndef _BenchOps_icpp_init_stub
#define _BenchOps_icpp_init_stub
#include "Core/init"
#endif