Leverage execution policies inside dbAsIfFlatRegion object traversal - #2365
Open
nikosavola wants to merge 2 commits into
Open
nikosavola wants to merge 2 commits into
nikosavola wants to merge 2 commits into
Conversation
nikosavola
marked this pull request as ready for review
September 25, 2026 07:46
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.
Same idea as #2364, but for
dbAsIfFlatRegion.merge_polygons_tobuffers the polygons with properties and sorts them by property ID before grouping. That sort now usesstd::execution::parwhere the standard library supports execution policies, and stays a plainstd::sortwhere it doesn't (macOS/libc++, MSVC without TBB, C++11 builds). The guards are__cpp_lib_executionand__has_include(<execution>).Benchmark
The
region_merge_propertiescase from thedb_parallel_benchmarksGoogle Benchmark suite on theparallelize-rebasedbranch of my fork runsRegion#mergedend to end on a flat region of property-tagged boxes, so the timing includes everything around the sort, not just the sort itself.-O2, TBB 2021.11taskset, which also throttles the TBB pool since it sizes itself from the affinity maskAt 4096 boxes the picture is the same: 1.00x on one core, 1.12x at 16.
The sort is a small part of the whole merge, so the operation gains about 10% and flattens out near 1.12x. Nothing changes single-threaded. I also ran the same benchmark on an Apple M5 (aarch64, Ubuntu container) and the numbers follow the same curve, so this is not x86-specific.