Skip to content

Instantly share code, notes, and snippets.

@ishidur
Last active September 11, 2018 03:25
Show Gist options
  • Save ishidur/83826a8e6adbd23430f7eb39a7f423d2 to your computer and use it in GitHub Desktop.
Save ishidur/83826a8e6adbd23430f7eb39a7f423d2 to your computer and use it in GitHub Desktop.
C++の実行速度のテスト

C++ benchmark test

Problem

Fibonacci number: 40

Result

Visual Studio

  1. x64
    1. Debug
      5.063179 sec.
      4.965487 sec.
    2. Release
      0.532715 sec.
      0.535705 sec.
  2. x86
    1. Debug
      4.796800 sec.
      4.747221 sec.
    2. Release
      0.569646 sec.
      0.562492 sec.

CLion

  1. Debug
    0.723952 sec.
    0.694875 sec.

Summary

  • x64とx84の違いはあまり見られない
  • DebugとReleaseでは実行速度に大きな差が確認できる
  • この差はコンパイルオプションの差によるものと考えられる
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment