[PERF] Manual import preview loads up to 20 full Book entities per file (GetBooks in EvaluateHolyGrailMatchFileInternal); cache per preview call by book id
Maintainers usually reply within 7 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp, postgresql
- Domain
- backend, performance
Research direction
Start in FileMatchingService.EvaluateHolyGrailMatchFileInternal and compare the per-file GetBooks, GetBook, and GetAuthor calls with the memoization approach in issue #253. Measure one preview with pg_stat_statements and thread snapshots, as described in the issue. Done means hydrated books and authors are reused by id for that preview call and the repeated database work drops.
Written by the indexing model from the issue text.
Description
Problem
A 655-file audiobook manual import preview takes ~512 s (~0.75 s per file) even with recall and ranking memoized (#253: 577 s -> 512 s). The remaining cost is inside FileMatchingService.EvaluateHolyGrailMatchFileInternal, per file: _bookService.GetBooks(uniqueBookIds) (~line 6024) hydrates up to 20 books with editions and authors per file, plus GetBook (~4670, ~9384) and GetAuthor (~4402) per candidate. Tags and durations are cached per path; GetAllAuthors is cached.
Suggested direction
Cache hydrated books/authors by id for the duration of one preview call (like the memo in #253), so 655 chapters of one audiobook load the same candidate books once. Cheapest measurement first: diff pg_stat_statements calls/rows for the Editions.*, Books.*, Authors.* join and take thread snapshots during one preview. Found while reviewing #253.
- Dominant language
- C#
- Stars
- 664
- Forks
- 48
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Chaptarr/chaptarr
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Chaptarr/chaptarr#313 · 1 comment ·
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 7 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 7 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 7 days
All issues in Chaptarr/chaptarr
Similar issues
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
elastic/docs-builder#4495 ·
Maintainers usually reply within 1 day
-
ASP.NET Core container quickstart: `docker-run: debug` task sample is missing its closing braceOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
microsoft/vscode-docs#10499 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
🌶️ hot chocolate
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ChilliCream/graphql-platform#10567 ·
Maintainers usually reply within 1 day