perf(boolean-intersects): delegate flattening to booleanDisjoint#3103
Merged
mfedderly merged 2 commits intoJul 22, 2026
Conversation
…Disjoint` `booleanDisjoint` already compares every flattened geometry pair internally. I also removed @turf/meta and @turf/helpers from the package's dependencies since nothing in the package imports them anymore (helpers was unused even before this change). Benchmarks show between +50% and +100% improvement in speed on MacBook M4 Pro.
rexxars
force-pushed
the
perf/intersects-disjoint-delegate
branch
from
July 21, 2026 22:47
8765bc6 to
ed121a1
Compare
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.
booleanIntersectsflattens both features into every pair of simple geometries and callsbooleanDisjointper pair. ButbooleanDisjointperforms the exact same nested flattenEach internally, with the inverse accumulation ("all pairs disjoint" vs "any pair intersects"). Sinceintersects == !disjointholds for multi-geometries too, the entire body can be reduced to:This is the same category of #3011 - deduplicating/delegating to what the negated variant does, and reducing maintenance surface. I also removed
@turf/metaand@turf/helpersfrom the package's dependencies since nothing in the package imports them anymore (helpers was unused even before this change). Let's see if CI complains.Benchmarks show a marked improvement on my M4 MacBook Pro:
Please provide the following when creating a PR:
contributorsfield ofpackage.json- you've earned it! 👏