2 ms·
FWIW, I did a more direct translation[1] of the Nim code into C++. The current C++ code does things like memcpy a std::bitset on every recursive call. I also wa
by detrino 12y ago
FWIW, I did a more direct translation[1] of the Nim code into C++. The current C++ code does things like memcpy a std::bitset on every recursive call. I also wanted the code to be doing the exact same thing as Nim is (vector with 1 byte per bool, globals for data, and I left everything as int when I would normally use other types).
The result is that C++ now just barely outperforms Nim: 1074ms for C++ vs 1165ms for Nim.
[1] http://ideone.com/q838cJ http://ideone.com/q838cJ