Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve RelateNG performance for A/L cases in prepared predicates #1201

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented Nov 25, 2024

Improve the RelateNG self-noding check to allow A-L cases to take advantage of prepared predicates.

Previously, A/L cases were not using the prepared noder cache for predicates which require self-noding (such as contains, covers, relate etc). This caused significantly poor performance for a common situation. The self-noding check has been refined to allow A/L cases to be use the cached noder.

This makes RelateNG in prepared mode as fast as PreparedGeometry for all cases (and it handles more cases).

Port of locationtech/jts#1099

For example, a test in perf_topo_predicate has dramatically reduced execution time (133x faster):

16001, 961, 759, LineString, 101, RelateOp - contains, 221629, 1.0
16001, 961, 759, LineString, 101, Geometry - contains, 62459, 3.5
16001, 961, 604, LineString, 101, PreparedGeom - contains, 1984, 111.7
BEFORE:
16001, 961, 604, LineString, 101, RelateNGPrepared - contains, 102700, 2.2
AFTER:
16001, 961, 604, LineString, 101, RelateNGPrepared - contains, 2236, 99.1

@dr-jts dr-jts added the Enhancement New feature or feature improvement. label Nov 25, 2024
@dr-jts dr-jts merged commit b0cec40 into libgeos:main Nov 25, 2024
28 checks passed
@dr-jts dr-jts deleted the improve-relateng-prepared-al branch November 25, 2024 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or feature improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant