Journal-finished gate in walkForRetired is O(entries x generations)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript
- Domain
- performance
Research direction
Read src/core/cache/maintenance.js around lines 2682 and 2758 to understand the generation-membership checks in walkForRetired. The acceptance condition is to use one Set for both checks when those checks are next modified; the issue describes this as a deferred, immaterial cleanup, not an urgent task.
Written by the indexing model from the issue text.
Description
Source: #2017 at 6bd3752d4a7e0f3fa70881e5f5e6a8c42aff5854
Location: src/core/cache/maintenance.js:2758
Severity: low
Evidence
entries.some(entry => cleanup.generations.includes(entry.name)) is O(entries x generations) per tick for a partition with a journal, and the short circuit only helps while a named generation is still present. The identical shape is already paid by the pre-existing per-entry includes at maintenance.js:2682.
Why deferral is safe
Bounded and measured immaterial: both loops are bounded by one partition's generation directory count (typically one to three, capped at 10000 by purge-cleanup.js:73), the gate allocates nothing and issues no syscall, and hoisting a Set would mean editing a line outside this PR's diff for no measurable gain. This is a cleanup for whenever that loop is next touched, per the repo's performance threshold (a measured-immaterial nit is a preference).
Acceptance condition
When walkForRetired's generation-membership checks are next modified, hoist cleanup.generations into a Set used by both the per-entry check at maintenance.js:2682 and the finished-journal gate at :2758.
Review preference; backlog only. A human may explicitly delegate it with neutral:fix.
- Dominant language
- JavaScript
- Stars
- 11
- Forks
- 0
- Avg merge
- 2h 55m
- Merged PRs (30d)
- 294
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 hyparam/hypaware
-
neutral:fix
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
report_commands.js runtime output still says 'server' in four places; one names the destinationOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Maintainers usually reply within 1 day
All issues in hyparam/hypaware
Similar issues
-
bug confirmed js v6
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
BUG
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
linuxmint/cinnamon-spices-applets#9223 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
nopSolutions/nopCommerce#8440 ·
Maintainers usually reply within 1 day
-
follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day