plantain
V2EX  ›  问与答

C++社区一般怎么确定性能瓶颈在哪儿?

  •  
  •   plantain · Mar 16, 2015 · 1868 views
    This topic created in 4098 days ago, the information mentioned may be changed or developed.
    我用 C++和 C#分别计算从 1 皇后到 12 皇后,都有哪些解,结果 C#用了 3.1-3.2 秒,用 C++写的竟然用到了了 17.6-17.9 秒,我是用 std:vector 来收集结果的,是这个产生的性能问题吗?

    C++版本代码: https://github.com/plantain-00/c-demo/blob/master/EightQueens/EightQueens/main.cpp

    C#版本代码: https://github.com/plantain-00/csharp-demo/blob/master/SevenQueens/Program.cs

    当然了,是在同一台机器上跑的。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1164 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 185ms · UTC 23:20 · PVG 07:20 · LAX 16:20 · JFK 19:20
    ♥ Do have faith in what you're doing.