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

avoid unneccessary geometry building during count/ratio requests #161

Merged
merged 1 commit into from
Aug 13, 2021

Conversation

tyrasd
Copy link
Member

@tyrasd tyrasd commented Mar 22, 2021

Description

Improve performance of count queries by skipping calling getGeometry in the count code paths. This eliminates the (sometimes expensive) construction of JTS geometries in cases where it is not actually needed.

Todo

  • perform some simple benchmarks to see how big of a difference this makes

Checklist

@tyrasd tyrasd added the enhancement New feature or request label Mar 22, 2021
@tyrasd tyrasd changed the title avoid unneccessary geometry building during count requests 🚧 avoid unneccessary geometry building during count requests Mar 24, 2021
@tyrasd tyrasd added the comments welcome Indicates that the creator of this issue/PR is open for early review comments label Mar 24, 2021
@tyrasd tyrasd force-pushed the avoid-unneccessary-geometry-building branch from a131d58 to 75057f3 Compare March 25, 2021 17:48
@tyrasd tyrasd added this to the 1.6 milestone Jun 22, 2021
@tyrasd tyrasd force-pushed the avoid-unneccessary-geometry-building branch 3 times, most recently from e7ba4b8 to cf3bcfc Compare August 3, 2021 15:53
@tyrasd tyrasd changed the title 🚧 avoid unneccessary geometry building during count requests 🚧 avoid unneccessary geometry building during count/ratio requests Aug 11, 2021
@tyrasd
Copy link
Member Author

tyrasd commented Aug 11, 2021

perform some simple benchmarks to see how big of a difference this makes

benchmark query: /elements/count/ratio?bboxes=8.61,48.02,11.87,51.66&filter2=type:way%20and%20building=yes&filter=type:way&format=json&time=2010-01-01%2F2020-01-01%2FP1M

master this branch
2 min 10 sec 1 min 55 sec

@tyrasd tyrasd force-pushed the avoid-unneccessary-geometry-building branch from eb2b6c7 to eaca19a Compare August 12, 2021 08:38
@tyrasd tyrasd changed the title 🚧 avoid unneccessary geometry building during count/ratio requests avoid unneccessary geometry building during count/ratio requests Aug 12, 2021
@tyrasd tyrasd added waiting for review This pull request needs a code review and removed comments welcome Indicates that the creator of this issue/PR is open for early review comments labels Aug 12, 2021
@tyrasd tyrasd force-pushed the avoid-unneccessary-geometry-building branch from eaca19a to 3d0d93d Compare August 13, 2021 09:09
Copy link
Member

@joker234 joker234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks pretty good 👍 Just some minor remarks/questions.

@tyrasd tyrasd removed the waiting for review This pull request needs a code review label Aug 13, 2021
@tyrasd tyrasd merged commit 44a7e04 into master Aug 13, 2021
@tyrasd tyrasd deleted the avoid-unneccessary-geometry-building branch August 13, 2021 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants