GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Windows ARM64 tail-call interpreter: compiler and commit performance effects · Issue #159521 · python/cpython Open Labels OS-windowsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usage DescriptionUpdate: The results below used Release builds without PGO or LTCG. See the [PGO+LTCG follow-up](#159521 (comment) for updated results and the maintained Gist for reproduction instructions. While testing and measuring the tail-call interpreter on Windows ARM64, with the goal of enabling it by default on WoA, I noticed a performance change across commit ad1513a, "Reduce the work done to spill and reload the stack around calls". I wanted to separate these effects before quoting a tail-call speedup. In terms of commits, both revisions are 3.16.0a0: 1. Effect of the commit and compiler version on the switch interpreter Put all four switch based builds on one common scale: before-commit MSVC 14.51 = 100. Higher means faster.
Before the commit, the compilers produce almost equally fast builds. After the commit, both switch builds slow down: by 7.51% with MSVC 14.51 and 3.62% with MSVC 14.52, each relative to its own before-commit build. Emulated x64. Testing x64 binaries under Windows emulation on the same ARM64 device also shows a switch slowdown across the commit with both compilers. In those runs, 14.52 does not provide the mitigation observed on native ARM64. The overall result varies across individual benchmarks: Most affected benchmarks when changing the compiler: 14.52 versus 14.51Each row below compares the switch build made with MSVC 14.52 against the switch build made with MSVC 14.51 at the same source revision. Positive means faster; negative means slower. † marks high variability (coefficient of variation above 10% in either compared build).
Most affected benchmarks across the commit: after versus beforeEach row below compares the after-commit switch build against its before-commit switch build, keeping the compiler unchanged. Positive means faster; negative means slower. † marks high variability (coefficient of variation above 10% in either compared build).
2. Tail-call versus switch: MSVC 14.52 Change only the interpreter. Both builds use MSVC 14.52. For each revision, the baseline is the switch build at that same revision.
Tail-call is faster than switch on both revisions: by 4.43% before the commit and 9.36% after it. These are two comparisons against the switch build at the corresponding revision. The previous table shows that the commit slows switch, which contributes to the larger after-commit tail-call advantage. Emulated x64. With MSVC 14.52 under x64 emulation, tail-call's advantage over switch at the same revision grows from 11.47% before the commit to 17.43% afterwards, mainly because switch slows down while tail-call speed changes little. These are relative comparisons within emulation; the percentages need confirmation on native x64 hardware. Most affected benchmarks: three largest gains and losses per comparisonThese use the same baseline as the table above. Positive means faster; negative means slower. † marks high variability (coefficient of variation above 10% in either compared build).
The tail-call interpreter should be enabled by default on Windows on Arm. Speedup claims should be precise and explicitly state the baseline, including the CPython revision, compiler version, and interpreter configuration. I'd also welcome someone repeating these experiments on native x86-64 (x64) hardware running Windows, as I don't currently have access to such a machine. :) The scripts and current reproduction instructions are maintained in the CPython Windows ARM64 PGO benchmark Gist. Download its four files together. To reproduce the PGO+LTCG follow-up, use the command there with Activity
MetadataMetadataAssigneesLabelsOS-windowsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usage ProjectsMilestoneRelationshipsDevelopmentIssue actions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |