Compiler optimizations can indeed affect the performance. As 12 is a constant the compiler might optimize calls and in theory it could calculate 12! compile time.
To see the behavior of code in a more real setting one could use a volatile variable.
Thanks for the testing btw.