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

misc: Retrieve roms by filename from database in bulk during scan #1336

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

adamantike
Copy link
Collaborator

The scanning process could try to fetch thousands of roms from the database, one by one, which is very inefficient, especially when only a few new roms are added to the library, as the overhead of database calls is very high compared to metadata API calls.

This change introduces a new method in the roms handler to retrieve roms by their file names in bulk, which is used during the scan process to fetch a batch of roms at once, instead of one by one.

It also avoids the @with_details decorator when fetching roms during the scanning process, as those details are not needed, and they were adding unnecessary joins and data decoding.

Copy link

github-actions bot commented Dec 2, 2024

Test Results

88 tests  ±0   88 ✅ ±0   26s ⏱️ -1s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 0a4c81d. ± Comparison against base commit e0acda4.

♻️ This comment has been updated with latest results.

The scanning process could try to fetch thousands of roms from the
database, one by one, which is very inefficient, especially when only a
few new roms are added to the library, as the overhead of database calls
is very high compared to metadata API calls.

This change introduces a new method in the roms handler to retrieve roms
by their file names in bulk, which is used during the scan process to
fetch a batch of roms at once, instead of one by one.

It also avoids the `@with_details` decorator when fetching roms during
the scanning process, as those details are not needed, and they were
adding unnecessary joins and data decoding.
@adamantike adamantike force-pushed the misc/bulk-get-roms-by-filename-during-scan branch from 05e40c6 to 0a4c81d Compare December 2, 2024 03:00
@adamantike adamantike merged commit 0f3ff7e into master Dec 2, 2024
8 checks passed
@adamantike adamantike deleted the misc/bulk-get-roms-by-filename-during-scan branch December 2, 2024 12:58
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.

2 participants