Taking your code I have Solution 1 required 0.03380799293518066 seconds to count to 100000000. Solution 2 required 0.03265786170959473 seconds to count to 100000000. Solution 3 required 0.09943199157714844 seconds to count to 100000000.
Fedora 25, 64bit, nim 0.15.2, and just nim c -d:release Indeed --cc:clang makes it worse Solution 1 required 0.2279288768768311 seconds to count to 100000000. Solution 2 required 0.06590104103088379 seconds to count to 100000000. Solution 3 required 0.09804606437683105 seconds to count to 100000000.