When I compile the same code using cmake and just plain c++ script build the times are 1.3 milliseconds and 66 microseconds respectively for running the same function. I suppose the issue is in the compiler they use.