On 1/17/2022 8:47 PM, Barry Scott wrote:


On 17 Jan 2022, at 06:35, Tim Peters <tim.pet...@gmail.com> wrote:

[Guido]
I don't think there's a way to do a PGO build from Visual Studio; but
a command prompt in the repo can do it using `PCbuild\build.bat --pgo`.
Just be patient with it.

Thanks! That worked, and was easy, and gave me an executable that runs
"// 10" at supernatural speed.

Alas, Visual Studio will not show a disassembly window unless the
debugger is running, and there appears to be no way to convince it to
run its debugger without it first recompiling the source file you're
staring at. Which it recomplies without benefit of PGO.

The trick you need is to close the project you use to build python
from source then you can open the python.exe and run that under the
debugger. Because it can find the python.pdb it will source/disasm as
you want.

Or you can Debug/Attach to the process if you start it running outside of Visual Studio.

You should also be able to just select the "PGUpdate" configuration (either from the dropdown in the toolbar, on Build/Configuration Manager). Provided you've done a PGO build from the command line, it will have the profile, and should be able to fairly quickly rebuild and reapply it - even with code changes - and start debugging.

Or you can try and enable the preprocessed assembler output from the compiler. I'm not sure how that handles PGO though, since the assembly comes from the compiler but it's the linker that does most of the optimisation. Attaching to a running process is what I normally do.

Cheers,
Steve
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/UFGYPAOZ5G7MN2QYYGUDAGJ3X6OCYP6F/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to