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 #1099

Merged

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented Nov 24, 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).

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

-------  Running with A: polygon # pts = 200000   B # pts = 400  x 10000 lines
runContainsOld : 9888 ms
runContainsOldPrep : 36 ms
runContainsNG : 5906 ms

BEFORE: runContainsNGPrep : 4540 ms
NOW:    runContainsNGPrep : 34 ms

@dr-jts dr-jts changed the title Fix RelateNG to cache in prepared A-L cases Refine RelateNG self-node check to improve performance for prepared A-L cases Nov 24, 2024
@dr-jts dr-jts changed the title Refine RelateNG self-node check to improve performance for prepared A-L cases Improve RelateNG performance for A/L cases in prepared predicates Nov 24, 2024
@dr-jts dr-jts merged commit c3d56e6 into locationtech:master Nov 24, 2024
2 checks passed
@dr-jts dr-jts deleted the fix-relateng-polygon-lines-caching branch November 24, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant