Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #gcc
- $ gcc --version
- gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
- $ gcc -O3 -o sum sum.c
- $ time ./sum 5000
- ./sum 5000 1.17s user 0.00s system 99% cpu 1.171 total
- $ sudo perf stat ./sum 5000
- Performance counter stats for './sum 5000':
- 1168.298144 task-clock (msec) # 1.000 CPUs utilized
- 29 context-switches # 0.025 K/sec
- 0 cpu-migrations # 0.000 K/sec
- 55 page-faults # 0.047 K/sec
- 5,023,172,901 cycles # 4.300 GHz
- 18,773,198,728 instructions # 3.74 insn per cycle
- 1,256,435,755 branches # 1075.441 M/sec
- 1,011,161 branch-misses # 0.08% of all branches
- 1.168475610 seconds time elapsed
- #clang
- $ clang --version
- clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
- $ clang -O3 -o sum sum.c
- $ time ./sum 5000
- ./sum 5000 4.65s user 0.00s system 99% cpu 4.656 total
- $ sudo perf stat ./sum 5000
- Performance counter stats for './sum 5000':
- 4656.012983 task-clock (msec) # 1.000 CPUs utilized
- 16 context-switches # 0.003 K/sec
- 0 cpu-migrations # 0.000 K/sec
- 52 page-faults # 0.011 K/sec
- 20,019,074,780 cycles # 4.300 GHz
- 53,775,258,783 instructions # 2.69 insn per cycle
- 1,255,158,509 branches # 269.578 M/sec
- 1,027,384 branch-misses # 0.08% of all branches
- 4.655998791 seconds time elapsed
Advertisement
Add Comment
Please, Sign In to add comment