36 ms·
The last time I saw a FizzBuzz post, I wrote a fairly typical mod and if version, and one that used a mod and lookup table both in C. It turned out the compile
by rdc12 12y ago
The last time I saw a FizzBuzz post, I wrote a fairly typical mod and if version, and one that used a mod and lookup table both in C.
It turned out the compiler (clang and I think gcc as well) had converted the branchy version into a lookup table, that ran a tiny bit faster then the lookup table by hand. The assembly looked fairly similar so it was something fairly subtle, but I was out of my depth at that point.