Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[PERF] Manual import preview loads up to 20 full Book entities per file (GetBooks in EvaluateHolyGrailMatchFileInternal); cache per preview call by book id

Open
#256 0 comments 0 reactions 0 assignees View on GitHub

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

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

enhancement

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Chaptarr/chaptarr

All issues in Chaptarr/chaptarr

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.