Journal-finished gate in walkForRetired is O(entries x generations)

Aperta
#2,023 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
performance

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
11
Fork
0
Merge medio
2h 25m
PR unite (30g)
311

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hyparam/hypaware

Tutte le issue di hyparam/hypaware

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.