Try   HackMD

2017q3 Homework(clz)

github

開發環境

OS:ubuntu 16.04 LTS

$ lscpu

​​​​Architecture:          x86_64
​​​​CPU op-mode(s):        32-bit, 64-bit
​​​​Byte Order:            Little Endian
​​​​CPU(s):                8
​​​​On-line CPU(s) list:   0-7
​​​​Thread(s) per core:    2
​​​​Core(s) per socket:    4
​​​​Socket(s):             1
​​​​NUMA node(s):          1
​​​​Vendor ID:             GenuineIntel
​​​​CPU family:            6
​​​​Model:                 94
​​​​Model name:            Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
​​​​Stepping:              3
​​​​CPU MHz:               799.987
​​​​CPU max MHz:           4000.0000
​​​​CPU min MHz:           800.0000
​​​​BogoMIPS:              6816.00
​​​​Virtualization:        VT-x
​​​​L1d cache:             32K
​​​​L1i cache:             32K
​​​​L2 cache:              256K
​​​​L3 cache:              8192K
​​​​NUMA node0 CPU(s):     0-7

量測結果

  • recursive version

    • 測試結果
  • iteration version

    • 測試結果
  • binary search technique

    • 測試結果
      binary search 在輸入接近10000時,會產生明顯抖動的現象發生!
  • byte-shift version

    • 測試結果
  • Harley’s algorithm

    • 測試結果

測試結果比較

參考資料

gnu Makefile 使用手冊
gcc與Makefile使用筆記