Free-threaded Python collection performance on MacOS (continued)

A few days ago I posted my early findings highlighting a considerable performance issue with Free Threaded Python on my (intel-based) MacOS, compared to Linux. Here’s the thread: Free-threaded Python collection performance on MacOS

I have since pushed the simple benchmark script to a repo with instructions to see if someone wants to replicate them: GitHub - santiagobasulto/python-free-threaded-performance-analysis

Quick note: these benchmarks are fairly “artificial”. I know we shouldn’t spawn 100 threads in a 8-physical-core CPU, or that collections are not designed for concurrent access, etc.

This is just an “extreme” experiment to show that something might be going on with MacOS (maybe it’s just my latptop). Even though we shouldn’t create 100 threads to edit concurrently a dictionary, there’s something odd if it takes 4 seconds on a 4-core Linux and 800 seconds on a MacOS with 8-cores.

2 Likes