Why gprof gives empty log file on Windows 10?

No. The code, and the flag are exactly the same. All the difference you saw are simply caused by using equation.com version gfortran vs. cygwin64 gfortran. It is what it is.
In fact, you could install cygwin64 and check it yourself and then make conclusion. You could check @mecej4 reply as well,

This same code, cygwin64 took like 0.7-0.8s, while equation.com gfortran took 2.8-3s. So 4X difference.
However, for more complicated code, equation.com gfortran seems perform much better than cygwin64 version. That is why I claim the performance of Windows version gfortran are not consistent with each other. Again, you could check by yourself.

By the way, in the code, functoin pyq_i_detail and pyq_i_o are exactly the same. pyq_i_o is never used, so I do not know why cygwin64 show pyq_i_o in the report.

I never say Ubuntu is better than Windows, not to say ‘much better’ :sweat_smile:
I am just saying that based on my experience, gfortran on Linux performs noticeably faster than on Windows. Again, in fact, you could simply try to install Linux and run gfortran there. I believe it is very likely you will notice the performance difference.

I also want to develop some software using gfortran on windows, but again, the windows version gfortran did not perform as I expected, not to say that my application need MPI support. Fortunately, Intel OneAPI performs good enough.

Because my report are always empty, so I try to run the bat using administrator permission. If I do not add cd /d “%~dp0”, the cmd under administrator permission will locate at system32 folder which is wrong.

Yeah I know. That is why I am confused. Yes, I deleted gmon.out, etc. No matter what I try, it seems equation.com gfortran produce empty profile results :sweat_smile: