README.md 4.32 KB
Newer Older
Arnaud Blanchard's avatar
Arnaud Blanchard committed
1
Operation `x=x/3+3` on  array of 1 000 000 int
Arnaud Blanchard's avatar
Arnaud Blanchard committed
2

Arnaud Blanchard's avatar
Arnaud Blanchard committed
3
4
5
Tests on Macbook Air 2,2 GHz Intel Core i7, 8 Go 1600 MHz DDR3

With `clang v10 C -O3`
Arnaud Blanchard's avatar
Arnaud Blanchard committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20


```
Finish '<' 365ms '!=' 371ms '--' 425ms total:1162ms
Finish '<' 386ms '!=' 381ms '--' 432ms total:1200ms
Finish '<' 372ms '!=' 359ms '--' 416ms total:1148ms
Finish '<' 370ms '!=' 355ms '--' 418ms total:1144ms
Finish '<' 425ms '!=' 476ms '--' 478ms total:1380ms
Finish '<' 449ms '!=' 473ms '--' 500ms total:1423ms
Finish '<' 388ms '!=' 376ms '--' 461ms total:1225ms
Finish '<' 424ms '!=' 471ms '--' 440ms total:1336ms
Finish '<' 375ms '!=' 352ms '--' 495ms total:1222ms
Finish '<' 467ms '!=' 400ms '--' 424ms total:1291ms
```

Arnaud Blanchard's avatar
Arnaud Blanchard committed
21
With `clang v10  C -O3 -march=native`
Arnaud Blanchard's avatar
Arnaud Blanchard committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

```
Finish '<' 282ms '!=' 254ms '--' 288ms total:825ms
Finish '<' 268ms '!=' 253ms '--' 298ms total:820ms
Finish '<' 272ms '!=' 256ms '--' 298ms total:826ms
Finish '<' 286ms '!=' 264ms '--' 303ms total:854ms
Finish '<' 279ms '!=' 264ms '--' 296ms total:841ms
Finish '<' 276ms '!=' 254ms '--' 305ms total:836ms
Finish '<' 275ms '!=' 262ms '--' 302ms total:840ms
Finish '<' 280ms '!=' 263ms '--' 309ms total:853ms
Finish '<' 269ms '!=' 254ms '--' 297ms total:821ms
Finish '<' 269ms '!=' 254ms '--' 289ms total:813ms
```


Arnaud Blanchard's avatar
Arnaud Blanchard committed
37
With `clang v10 C++ -O3`
Arnaud Blanchard's avatar
Arnaud Blanchard committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51

```
Finish c-style: 422ms 361ms 409ms valarray: 362ms  vector:  354ms 348ms  353ms total:2613ms
Finish c-style: 367ms 368ms 403ms valarray: 378ms  vector:  361ms 358ms  360ms total:2597ms
Finish c-style: 371ms 364ms 412ms valarray: 356ms  vector:  359ms 370ms  373ms total:2608ms
Finish c-style: 391ms 362ms 409ms valarray: 356ms  vector:  349ms 350ms  364ms total:2585ms
Finish c-style: 369ms 372ms 404ms valarray: 364ms  vector:  352ms 352ms  354ms total:2570ms
Finish c-style: 362ms 354ms 432ms valarray: 354ms  vector:  360ms 362ms  348ms total:2575ms
Finish c-style: 361ms 355ms 397ms valarray: 355ms  vector:  350ms 351ms  351ms total:2523ms
Finish c-style: 377ms 360ms 431ms valarray: 358ms  vector:  350ms 351ms  348ms total:2578ms
Finish c-style: 375ms 362ms 413ms valarray: 366ms  vector:  352ms 350ms  350ms total:2572ms
Finish c-style: 372ms 364ms 414ms valarray: 350ms  vector:  359ms 359ms  360ms total:2580ms
```

Arnaud Blanchard's avatar
Arnaud Blanchard committed
52
With `clang v10 C++ -O3 -march=native`
Arnaud Blanchard's avatar
Arnaud Blanchard committed
53
54
55
56
57
58
59
60
61
62
63
64

```
Finish c-style: 279ms 306ms 307ms valarray: 283ms  vector:  285ms 289ms  279ms total:2031ms
Finish c-style: 295ms 335ms 314ms valarray: 295ms  vector:  290ms 303ms  288ms total:2124ms
Finish c-style: 285ms 306ms 307ms valarray: 276ms  vector:  285ms 286ms  284ms total:2032ms
Finish c-style: 311ms 352ms 332ms valarray: 276ms  vector:  293ms 293ms  294ms total:2154ms
Finish c-style: 289ms 310ms 309ms valarray: 272ms  vector:  279ms 285ms  283ms total:2031ms
Finish c-style: 294ms 320ms 319ms valarray: 276ms  vector:  278ms 275ms  272ms total:2039ms
Finish c-style: 283ms 310ms 307ms valarray: 276ms  vector:  295ms 292ms  294ms total:2060ms
Finish c-style: 317ms 315ms 317ms valarray: 277ms  vector:  278ms 298ms  281ms total:2088ms
Finish c-style: 285ms 315ms 313ms valarray: 274ms  vector:  281ms 277ms  277ms total:2025ms
Finish c-style: 285ms 308ms 305ms valarray: 287ms  vector:  279ms 277ms  279ms total:2023ms
Arnaud Blanchard's avatar
Arnaud Blanchard committed
65
66
67
68
69
70
71
72
73
74
75
76
77
```
Used command in blaar

```
./compile test_optim
for i in  {1..10}; do  bin/test_c; done;`
for i in  {1..10}; do  bin/test_cpp; done;`
```

The compile flags are in the respective CMakeLists.txt files. `-O3  -DNDEBUG` is the default. 

In DEBUG mode the containers are much slower that in simple c-style.

Arnaud Blanchard's avatar
Arnaud Blanchard committed
78
With ```g++ v9 C++ -O3 -march=native```
Arnaud Blanchard's avatar
Arnaud Blanchard committed
79

Arnaud Blanchard's avatar
Arnaud Blanchard committed
80
81
82
83
84
85
86
87
88
89
90
91
```
Finish c-style: 221ms 213ms 275ms valarray: 303ms  vector:  224ms 219ms  221ms total:1680ms
Finish c-style: 266ms 259ms 332ms valarray: 293ms  vector:  222ms 219ms  215ms total:1808ms
Finish c-style: 223ms 212ms 277ms valarray: 312ms  vector:  218ms 211ms  214ms total:1669ms
Finish c-style: 216ms 211ms 264ms valarray: 287ms  vector:  222ms 249ms  253ms total:1706ms
Finish c-style: 254ms 247ms 275ms valarray: 311ms  vector:  222ms 220ms  220ms total:1752ms
Finish c-style: 240ms 225ms 277ms valarray: 523ms  vector:  330ms 236ms  254ms total:2089ms
Finish c-style: 229ms 222ms 277ms valarray: 359ms  vector:  231ms 224ms  245ms total:1790ms
Finish c-style: 235ms 220ms 279ms valarray: 301ms  vector:  224ms 219ms  242ms total:1722ms
Finish c-style: 278ms 278ms 328ms valarray: 302ms  vector:  215ms 228ms  316ms total:1949ms
Finish c-style: 222ms 216ms 351ms valarray: 386ms  vector:  249ms 303ms  224ms total:1954ms
```
Arnaud Blanchard's avatar
Arnaud Blanchard committed
92
93