fix: improve import speed - #335
Open
jgonet wants to merge 6 commits into
Open
Conversation
It's better to have fast import and backfill images after it.
We should avoid doing any image requests when importing.
We don't need to restart to kick it off.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
These changes modify few things:
KOITO_FETCH_IMAGES_DURING_IMPORT. Imported data is typically large and it's better to finish importing quickly and then backfill the images. I don't think Koito needs this configuration var, simpler config out of the box is better.SkipCacheImageto also avoid doing requests for image URL. Same reason as above.Each commit is isolated and the patchset should read better going one-by-one instead of looking at full diff.
Part of my changes to improve importer speed. I have one branch that wasn't cleaned up at all and I don't intend to upstream (jgonet@b50cc94) but it dramatically improves import speed – calculating stats for each imported item takes more time with more imported items.
Other venues not implemented: when importing, it would be great to batch entries with ~100-300 items chunks.
Note
This is my first contact with Go, so treat those changes with suspicion. Feel free to take any changes or implement it yourself, however you see fit. While I used LLMs for virtually everything, I heavily guided it onto this approach.
My import on current version of Koito took few hours which didn't sound right and motivated these changes.
Note
While implementing, I found possible bugs:
else ifin OK status code check.Type of Change
How Has This Been Tested?
Checklist
AI/LLM Usage