10倍は遅すぎませんか? 本の虫: Haskellで書いてみたらC++の10倍遅かった を読みました. 10倍は差が出過ぎなのではないかと思いました. C++ソースコード まずC++のソースコードが完全なものではないので補完しました. #include <algorithm> #include <array> #include <iostream> #include <random> template <typename Random> bool coin_toss(const unsigned int try_count, const unsigned int length, Random &r) { unsigned int count{}; int prev{}; std::uniform_int_distribution<> d(0, 1); for (unsigned int i
![Re:Haskellで書いてみたらC++の10倍遅かった 5倍程度になりました - ncaq](https://cdn-ak-scissors.b.st-hatena.com/image/square/3bd2cb143b4b0514dee0a986586e0b35904604f8/height=288;version=1;width=512/https%3A%2F%2Fwww.ncaq.net%2Ffavicon.png)