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 — gh-154013: Add free-threading test for shared struct.iter_unpack by johng · Pull Request #154141 · python/cpython Conversation
|
|
(AI report on the performance / overall change) Free-threaded ( The fixOn the free-threaded build, ThreadSanitizer verificationBuild:
PerformanceEnvironment. Apple Silicon (arm64), macOS; 6 performance cores / 18 logical. Single-threaded hot path (ns per element, min of 12 runs)Lower is better. Relative overhead is largest for a 1-field struct (least work
No measurable single-threaded regression (within run-to-run noise). Multi-threaded throughput (Melem/s, higher is better)Three workloads, three variants — all measured in one run:
Takeaways.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This is not worth the complexity. See the issue. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@ZeroIntensity this pattern seemed quite common and the solution to use the threaded serializer seems to come with a very high performance penalty |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Do you have real-world examples where people would benefit from fast, concurrent iteration here? The primary issue with the concurrent iteration pattern is that the order in which items are returned to each thread is non-deterministic; a thread has to somehow know where it is in the iterator (which is impossible to do safely without external locking) or not care about the position of the iterator, which is not a common occurrence, and there are usually better patterns (such as distributing items to worker threads sequentially, rather than letting each of them access the iterator). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.