Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add presets and a unified settings registry with real memory and CPU ceilings

Aperta
#91 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
cli, performance

Direzione di ricerca

Start by reading the existing CLI settings and resource-bound implementations named in the issue, including pkg/scanner/git.go, pkg/scanner/scanner.go, pkg/formats/types.go, pkg/projects/collect.go, pkg/registries/types.go, pkg/environments/types.go, pkg/scanner/structure.go, and pkg/discovery/discovery.go. Trace how current flags and bounds reach scanning, then review issues #1, #2, #29, #74, and #75. Done means the registry, presets, ceilings, provenance, reports, and listed acceptance tests are covered.

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

Descrizione

enhancement follow-up

Why

The goal is excellent defaults, plus deep, documented control over how dircue trades speed against memory and I/O. That is FFmpeg's philosophy:

  • -preset and -tune bundle many knobs;
  • -x264-params k=v reaches any knob;
  • -h full lists every option;
  • -threads, -probesize and -analyzeduration expose the resource trade-offs.

Today dircue exposes 11 resource-related user controls: --workers, --max-file-bytes, --tree-size, --metrics-max-file-bytes, --structural-max-file-bytes, --structural-timeout, GOMEMLIMIT, and a few others. About 20 internal bounds that materially affect speed and memory can't be changed, and aren't reported:

Bound Value Location
go-git object cache 96 MiB LRU third_party/go-git/plumbing/cache/common.go:14
Pack descriptor cap 8 pkg/scanner/git.go:45
Classification prefix 128 KiB pkg/scanner/scanner.go:36
Formats 64 KiB per file, 32 MiB total, 4,096 files pkg/formats/types.go
Manifest size 1 MiB pkg/projects/collect.go:10
Registries files 256 KiB pkg/registries/types.go
Environments budgets various pkg/environments/types.go
Function report limit 1,024 pkg/scanner/structure.go:201
Discovery evidence per kind 256 pkg/discovery/discovery.go:15

There are no presets and no enforced memory ceiling, and a report doesn't say which settings produced it. Separately, --max-file-bytes saves memory by dropping coverage, rather than by changing strategy.

Proposal

  • One typed settings registry as the single source for flags, --set, settings files, docs and provenance. Each entry has a name, unit, default, range, description and a category:
    • performance-only: must never change output;
    • coverage-affecting: changes what is analyzed, and is reported as such;
    • conformance-locked: e.g. Linguist's classification windows; changing one marks the output non-conformant.
  • Presets via --preset:
    • balanced: today's defaults;
    • fast: more workers, larger caches;
    • low-memory: fewer workers, small caches, streaming reads, a tight in-flight byte budget;
    • thorough: raises the coverage budgets (formats, functions, metrics sizes) and declares itself coverage-affecting.
  • Fine-grained overrides: --set key=value (repeatable) and --settings-file from the caller. Repository content can never supply settings.
  • capabilities --settings [--json] lists every setting with its default, range, category and the preset values, like ffmpeg -h full.
  • Real resource ceilings, which supersede and advance #1 and #2:
    • --memory-limit sets GOMEMLIMIT, bounds in-flight content bytes (backpressure), and scales caches and worker counts;
    • --cpu-limit derives GOMAXPROCS and worker scaling.
    • Each is documented honestly as cooperative or enforced (cgroup where available), and validated in cgroup-limited runs.
  • Provenance. Reports record the effective settings and their origin, and flag any coverage-affecting or conformance-locked deviations (#74, #29).

Acceptance

  • Registry plus presets plus --set, with every internal bound listed above either exposed or justified as fixed.
  • Metamorphic test: every preset and every performance-only setting produces byte-identical output on the golden corpus (#75).
  • low-memory meets a published RSS target on the kernel and large Java/.NET corpus entries under a cgroup limit, with fast's speed-up and cost measured alongside.
  • Effective settings are present in every JSON report and --stats output.

Part of the 1.0 quality program: #83. Epic: #81.

Lingua principale
Go
Stelle
0
Fork
0
Merge medio
5h 8m
PR unite (30g)
54

Preparare l'ambiente

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 war-and-code/dircue

Tutte le issue di war-and-code/dircue

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.