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

✨ Refactor & speedup insights search #3631

Merged
merged 12 commits into from
Dec 18, 2024
Merged

✨ Refactor & speedup insights search #3631

merged 12 commits into from
Dec 18, 2024

Conversation

Marigold
Copy link
Collaborator

@Marigold Marigold commented Nov 27, 2024

Refactor and speed up insights search. Its functionality isn't changing. Link to insights search on staging.

Refactoring

  • Move it into its own folder and split into data & app modules
  • Use Insight object instead of dicts
  • Improve url_persist

Performance

Instead of calculating embeddings on every launch, save them to disk and add missing ones on every load. This makes initial loading almost instant and also speeds up search.

@owidbot
Copy link
Contributor

owidbot commented Nov 27, 2024

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-insight-search-cache

chart-diff: ✅ No charts for review.
data-diff: ✅ No differences found
Legend: +New  ~Modified  -Removed  =Identical  Details
Hint: Run this locally with etl diff REMOTE data/ --include yourdataset --verbose --snippet

Automatically updated datasets matching weekly_wildfires|excess_mortality|covid|fluid|flunet|country_profile|garden/ihme_gbd/2019/gbd_risk are not included

Edited: 2024-11-28 08:48:46 UTC
Execution time: 13.75 seconds

@Marigold Marigold force-pushed the insight-search-cache branch from edbc0bd to bbe77bb Compare November 27, 2024 09:24
@Marigold Marigold force-pushed the insight-search-cache branch from 8e5a726 to 3812111 Compare November 28, 2024 08:45
@Marigold Marigold force-pushed the insight-search-cache branch from 3812111 to 8889d92 Compare December 18, 2024 10:41
@Marigold Marigold changed the title ✨ Speed up initial loading of insight search ✨ Refactor & speedup insights search Dec 18, 2024
@Marigold Marigold requested a review from lucasrodes December 18, 2024 10:49
@Marigold Marigold marked this pull request as ready for review December 18, 2024 10:49
Copy link
Member

@lucasrodes lucasrodes left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Mojmir! Nice idea abstracting the logic to Doc class!!

@Marigold Marigold merged commit e5923db into master Dec 18, 2024
4 of 7 checks passed
@Marigold Marigold deleted the insight-search-cache branch December 18, 2024 12:32
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.

3 participants