Repository navigation
Conversation
The intensification and expansion tasks are Python bound, so the ThreadPool only added GIL contention. Measured on the global case: 16.2 s threaded, 11.1 s with serial passes. The pool was also sized to the number of unique integers in the (region, metric) index pairs rather than to the number of tasks. Each task modifies only its own region x metric cells and target_change entries, and since 1.1 no shared input is mutated, so serial execution gives bit-identical results. The kernel density convolution keeps its thread pool, because ndimage.convolve releases the GIL (all serial: 21.9 s). The pool is now capped at the CPU count instead of one thread per land class. Benchmark vs v3.0.0-b4 (all IDENTICAL): - global_0p5deg: 16.9 s -> 12.1 s (-28%), peak RSS -17%. - global_0p5deg_negcons: 17.1 s -> 11.7 s (-32%). - texas_0p5deg: 0.22 s -> 0.17 s (-20%). The global case has gone from 34.0 s at b0 to 12.1 s (-64%). Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked PR — part of the Demeter v3.0.0 upgrade. Base:
v3/packaging-repo. Review and merge in order, bottom of the stack first.Plan items: 3.4 (partial)
Benchmark: IDENTICAL. Global case 16.9 → 12.1 s (−28%), RSS −17%.
Commits
Run region x metric tasks serially; cap convolution threads at CPU count
The intensification and expansion tasks are Python bound, so the
ThreadPool only added GIL contention. Measured on the global case: 16.2 s
threaded, 11.1 s with serial passes. The pool was also sized to the
number of unique integers in the (region, metric) index pairs rather
than to the number of tasks. Each task modifies only its own region x
metric cells and target_change entries, and since 1.1 no shared input
is mutated, so serial execution gives bit-identical results.
The kernel density convolution keeps its thread pool, because
ndimage.convolve releases the GIL (all serial: 21.9 s). The pool is now
capped at the CPU count instead of one thread per land class.
Benchmark vs v3.0.0-b4 (all IDENTICAL):
The global case has gone from 34.0 s at b0 to 12.1 s (-64%).
🤖 Generated with Claude Code