mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
.benchmarks
git-svn-id: svn://ultimatepp.org/upp/trunk@9479 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
dd94cb4c34
commit
06aea21228
3 changed files with 27 additions and 2 deletions
|
|
@ -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++) {
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@ file
|
|||
BenchOps.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
"" = "MT";
|
||||
|
||||
|
|
|
|||
4
benchmarks/BenchOps/init
Normal file
4
benchmarks/BenchOps/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _BenchOps_icpp_init_stub
|
||||
#define _BenchOps_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue