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

Optimised taglocations API #10028

Merged
merged 1 commit into from
Aug 17, 2021
Merged

Optimised taglocations API #10028

merged 1 commit into from
Aug 17, 2021

Conversation

17sushmita
Copy link
Member

Fixes #9946

Very similar fix as in #9940
We can further optimise it but this fix also optimises very significantly.

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

Before:

GET: http://publiclab.org/api/srch/taglocations?nwlat=52&selat=-52&nwlng=-150&selng=150
Time: 19.43s
image

After:

GET: http://publiclab.org/api/srch/taglocations?nwlat=52&selat=-52&nwlng=-150&selng=150
Time: 1991ms
image

@gitpod-io
Copy link

gitpod-io bot commented Aug 17, 2021

@codeclimate
Copy link

codeclimate bot commented Aug 17, 2021

Code Climate has analyzed commit d38287c and detected 0 issues on this pull request.

View more on Code Climate.

@17sushmita
Copy link
Member Author

Also noting that we are currently extracting all the node ids and then selecting only those node ids using the IN operator in SQL which I think can be optimised by skipping the redundant steps and merging both in the same query. However, I'm not very sure, it will require a bit of research.

@17sushmita
Copy link
Member Author

Also we can think of implementing caching as suggested by @jywarren by removing the precision and storing cache for rounded off values.

Copy link
Member

@jywarren jywarren left a comment

Choose a reason for hiding this comment

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

Hooray!!!! Excellent work!!!

@jywarren jywarren merged commit 33f2164 into publiclab:main Aug 17, 2021
@jywarren
Copy link
Member

🎉 🎉 🎉 🎉 🎉

@jywarren
Copy link
Member

Hi @17sushmita did some of what I'm talking about in #9946 (comment) make sense to you? Did you want to dive deeper into it with Barun and I?

reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimise tagLocations
2 participants