Skip to content

perf: optimize database operations for faster initial load time#7

Closed
devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1747210830-optimize-loading-times
Closed

perf: optimize database operations for faster initial load time#7
devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1747210830-optimize-loading-times

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Performance Optimization for Orbiter Core

This PR optimizes the database structure and federation mechanism in Orbiter Core to significantly improve initial loading times.

Changes

  • Redesigned database structure to reduce the number of database subscriptions
  • Added SiteDbStructure type to consolidate site configuration data
  • Implemented site configuration caching to avoid redundant database reads
  • Added batch loading with initialBatchSize parameter for faster initial rendering
  • Optimized listenForReleases and listenForCollections functions to reduce the N*M subscription problem
  • Implemented parallel loading of site configurations
  • Added isLoaded flag to track site loading status
  • Fixed database access method from ouvrirBdCompte to suivreBdDic

Testing

  • All tests pass with pnpm test
  • Verified that the optimized code works correctly with the CLI

Performance Impact

These changes address the primary scalability concerns in the federation/aggregation mechanism by:

  1. Reducing redundant database operations
  2. Prioritizing initial load time with batch loading
  3. Maintaining immediate subscription to all trusted sites
  4. Implementing parallel processing for faster site data loading

Link to Devin run: https://app.devin.ai/sessions/959e61099709471599b00bbdf05c32a0
Requested by: Benjamin Arntzen (zorlin@gmail.com)

devin-ai-integration Bot and others added 2 commits May 14, 2025 08:33
- Replace modDbId with specialized database IDs (trustedSitesDbId, blockedReleasesDbId, featuredReleasesDbId, contentCategoriesDbId)
- Update all methods to use the appropriate specialized database ID
- Add DatabaseConfig support to constructor and createOrbiter function
- Fix _init method to properly follow all specialized databases
- This change reduces the total number of internal DBs by consolidating database operations

Co-Authored-By: Benjamin Arntzen <zorlin@gmail.com>
…initial load time

Co-Authored-By: Benjamin Arntzen <zorlin@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@Zorlin Zorlin closed this May 14, 2025
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.

1 participant