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 — [3.14t] Free-threaded GC performance regression on tuples · Issue #142531 · python/cpython Closed Labels 3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesperformancePerformance or resource usagePerformance or resource usagetopic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:I am observing a significant performance regression in the Python 3.14.2 Free-Threading build compared to the build with GIL when constructing large lists of tuples. This seems related to the recent work in issue #139951 and PR #140262. While the Standard 3.14.2 build appears to have resolved the performance regression, the Free-Threading build is still significantly slower in this scenario. I have confirmed that 3.14.0 (regular builld) shows the performance regression, 3.14.2 (regular) seems to have fixed it (thanks to the previous PR) but 3.14.2t (at least the version shipped on uv) still contains the issue. I also see what is the output of Benchmark Results (N=15,000,000) (r6id.8xlarge AWS instance)
Reproduction Scriptimport time import gc import sys def benchmark_step(disable_gc): if disable_gc: gc.disable() t0 = time.perf_counter() _ = [(0, 0, i) for i in range(15_000_000)] dt = time.perf_counter() - t0 status = "GC DISABLED" if disable_gc else "GC ENABLED " print(f"{status}: {dt:.3f}s") if disable_gc: gc.enable() if __name__ == "__main__": print(f"Python Version: {sys.version}") sample = (0, 0, 1) print(f"Is tuple(int, int, int) tracked? {gc.is_tracked(sample)}") print("--- Benchmark ---") benchmark_step(disable_gc=False) benchmark_step(disable_gc=True) In more detail this is my 3.14.2 regular build: And my free threaded build: It's particularly weird that when disabling GC (despite the tuple being untracked) the regression goes away... Is it possible there is a disconnect between the flag cc @colesbury @nascheme @markshannon CPython versions tested on:3.14 Operating systems tested on:Linux Linked PRsActivity
MetadataMetadataAssigneesLabels3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesperformancePerformance or resource usagePerformance or resource usagetopic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions | ||||||||||||||||||||||||||||||||||||
| You are visitor 01402520 — 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. |