Skip to content

[SIMBAD] Improve query region preformances#3235

Merged
bsipocz merged 4 commits into
astropy:mainfrom
cds-astro:perf-simbad-query-region
Mar 3, 2025
Merged

[SIMBAD] Improve query region preformances#3235
bsipocz merged 4 commits into
astropy:mainfrom
cds-astro:perf-simbad-query-region

Conversation

@ManonMarchand

Copy link
Copy Markdown
Member

While trying to help with #3209 I discovered that query_region timeouts for large number of centers (~500). However, the query is way faster with uploads for this case.

There is a strange behavior that for smaller queries, the former method is still faster. Maybe due to the writing and then reading time for the uploaded file? It's not an exact science, but I benchmarked a little, and found that switching around 300 centers between the former method and a TAP upload gave the best result.

That way, a query with the maximum number of lines allowed by the upload method (200 000 centers) executes in ~ 1m30 for a 1 arcmin radius. Users will still have to split into smaller queries if they have more than 200 000 centers.

@codecov

codecov Bot commented Feb 28, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.

Project coverage is 69.07%. Comparing base (311197b) to head (8c84b28).
Report is 333 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/simbad/core.py 86.36% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3235      +/-   ##
==========================================
+ Coverage   68.69%   69.07%   +0.38%     
==========================================
  Files         231      232       +1     
  Lines       19214    19617     +403     
==========================================
+ Hits        13199    13551     +352     
- Misses       6015     6066      +51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@keflavich keflavich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting! Thanks for these performance improvements!

@ManonMarchand

ManonMarchand commented Feb 28, 2025

Copy link
Copy Markdown
Member Author

Thanks for the super quick review!

I'm a bit uncertain about not having a remote test for the longer list of centers case though. I might add one with the SKIP_SLOW tag in the beginning of next week, please do not merge yet.

EDIT: I added a remote test and for 360 points I get a ~0.25s test duration so I added the test without the SKIP_SLOW.

@ManonMarchand ManonMarchand force-pushed the perf-simbad-query-region branch from dc765f8 to 77203fa Compare February 28, 2025 15:20
@bsipocz bsipocz added the simbad label Feb 28, 2025
@bsipocz bsipocz added this to the v0.4.10 milestone Feb 28, 2025

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two minor comments otherwise this looks all good.

Thanks!

Comment thread astroquery/simbad/core.py Outdated
Comment thread astroquery/simbad/core.py Outdated
@ManonMarchand ManonMarchand force-pushed the perf-simbad-query-region branch 2 times, most recently from 29531a2 to edbd6d8 Compare March 3, 2025 10:36
@ManonMarchand ManonMarchand force-pushed the perf-simbad-query-region branch from edbd6d8 to 8c84b28 Compare March 3, 2025 10:36

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for addressing the comments, it's looking all good!

@bsipocz bsipocz merged commit 72952b7 into astropy:main Mar 3, 2025
@ManonMarchand ManonMarchand deleted the perf-simbad-query-region branch March 3, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants