cpython icon indicating copy to clipboard operation
cpython copied to clipboard

Use faster APIs to calculate paths at startup for Store packaged Python on Windows

Open zooba opened this issue 2 years ago • 3 comments

These APIs were added in Windows 8, so we can safely backport.

zooba avatar Nov 10 '22 20:11 zooba

The rough testing I did showed about 50% reduction in startup time (~450ms->250ms) in non-ideal circumstances, but the Windows devs I was working with said it seemed right. The numbers were pretty stable.

zooba avatar Nov 10 '22 20:11 zooba

Okay, had to retract one of the major optimisations because it can be incorrect. That brings the improvement down to around 50ms, which is still worthwhile, but not as impressive.

However, users can at least override this perf impact by setting their own PYTHONUSERBASE env variable before launching.

zooba avatar Nov 10 '22 20:11 zooba

It's possible we might be able to bring that optimisation back, looks like Windows covers the concerning edge cases for us. Still checking

zooba avatar Nov 10 '22 22:11 zooba

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. 🐍🍒⛏🤖

miss-islington avatar Nov 23 '22 19:11 miss-islington

GH-99733 is a backport of this pull request to the 3.11 branch.

bedevere-bot avatar Nov 23 '22 19:11 bedevere-bot

GH-99734 is a backport of this pull request to the 3.10 branch.

bedevere-bot avatar Nov 23 '22 19:11 bedevere-bot