Run on both sable-deer and sable-intel which have the exact same OS (i.e. Ubuntu)
Try different compiler versions for C (i.e. gcc 5.4, clang 3.5 and clang 3.8)
Observations
No much difference between different platforms, though sable-deer and sable-intel have different CPU frequency (2.0 GHz vs. 3.6 GHz, see machine details)
No much difference between different compilers (between gcc, clang35, and clang38)
benchmark
impl.
compiler
platform
env.
input
mean
std
rep.
lavamd
c
gcc
sable-intel
native
medium
3.1095s
+-0.12%
10
lavamd
c
clang35
sable-intel
native
medium
3.2519s
+-0.14%
10
lavamd
c
clang38
sable-intel
native
medium
3.1092s
+-0.07%
10
lavamd
c
gcc
sable-deer
native
medium
3.4823s
+-0.94%
10
lavamd
c
clang35
sable-deer
native
medium
3.6138s
+-1.03%
10
lavamd
c
clang38
sable-deer
native
medium
3.4792s
+-0.87%
10
Related to Math Library
In lavamd, the math function exp occupies the most of computation time. We observed that
the performance of exp on different platforms returned significant varying results.
#define N 1000000
#define op exp // Operation
double res[N];
int main(){
clock_t t0 = clock(); // Timing starts
for(int i=0;i<N;i++){
res[i] = op(i * 0.2); // Core
}
clock_t t1 = clock(); // Timing ends
double s = 0;
for(int i=0;i<N;i++){
s = res[i];
}
printf("time: %lf ms\n", (t1-t0)*1.0/CLOCKS_PER_SEC*1000.0);
return s > 100;
}
There are two versions of the code:
Ver-op: with a math operation (#define op exp)
Ver-no-op: without a math operation (#define op)
Performance results (gcc 5.4, -O3)
Platforms
Ver-op (ms)
Ver-no-op (ms)
mbp-2015
6.9
3.4
Ubuntu-deer
103.3
7.4
We can see that the math operation exp is a very expensive operation on Ubuntu-deer. However, on Mac OS, the execution time doesn't go up much with this operation. :)
Problem Description
Execution time (Chrome63 used on Ubuntu-deer)
Experiments on Ubuntu
Setup
sable-deer
andsable-intel
which have the exact same OS (i.e. Ubuntu)Observations
sable-deer
andsable-intel
have different CPU frequency (2.0 GHz vs. 3.6 GHz, see machine details)Related to Math Library
In
lavamd
, the math functionexp
occupies the most of computation time. We observed that the performance ofexp
on different platforms returned significant varying results.There are two versions of the code:
#define op exp
)#define op
)Performance results (gcc 5.4, -O3)
We can see that the math operation
exp
is a very expensive operation on Ubuntu-deer. However, on Mac OS, the execution time doesn't go up much with this operation. :)