Listing and seeding repeat per-file work (binary sniff, YAML parse, stat)
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Refactoring
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- go, yaml
- Bereich
- cli, performance
Rechercherichtung
Read internal/walk/walk.go around ListWith and looksBinary, internal/seed/k8s.go around k8sLeads, and internal/seed/external.go around ignoreFiles. Start by running the existing walk and seed tests, then address one checklist item at a time; done means all three acceptance criteria hold and those tests pass unchanged.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
Three small, independent costs in the deterministic scan path that grow with the number of files and are cheap to remove.
Where
internal/walk/walk.go:308,:391(looksBinaryinside the single-threaded walk)internal/seed/k8s.go:66,:154,internal/seed/infra.go:59(k8sLeadsparses every YAML file in full)internal/seed/external.go:400-435(ignoreFilesstats once per listed file)
Details
- Binary sniff is serial.
ListWithopens, reads up to 8000 bytes and closes every regular file inside theWalkDircallback, on one goroutine, also when the map comes from the cache. Every listed file is opened again by the stage that reads it. Fix: collect candidates in the callback and sniff on a bounded worker pool (results stored by index so order is kept), aseachFiledoes for the seeders. - Kubernetes check parses first, filters second.
k8sLeadsbuilds a full YAML node tree for every non-workflow YAML file up to 1 MiB, and only then drops documents with noapiVersionor a non-workloadkind. Fix: return early when the text contains neitherapiVersionnorkind(accept the substring test only when the text holds no backslash, if escaped keys matter). - Ignore-file lookup stats per file. After semgrep or gitleaks returns,
ignoreFilescallsos.Stat(<dir>/<ignore name>)for every listed file; theseenmap only removes duplicates from the output. Fix: remember directories already checked.
Impact
Estimates from the code, not measured. At 100,000 listed files the serial sniff is about a second on Linux and an estimated 5 to 60 seconds on Windows under real-time antivirus; a repository with about 60 MB of non-Kubernetes YAML spends several CPU seconds per scan in the parser; with both scanners installed the ignore lookup makes 200,000 stats where a tenth would do.
Suggested fix
See the checklist above. Each item is independent and can land on its own.
Acceptance criteria
- Binary sniffing runs on a worker pool and listing order is unchanged
-
k8sLeadsskips files that cannot hold a workload without parsing them -
ignoreFilesstats each directory once - Existing walk and seed tests pass unchanged
Related: #18, #90
Getting started
- Relevant files: internal/seed/external.go, internal/seed/k8s.go, internal/walk/walk.go
- How to run tests:
make test-short(Unix) or.\make.ps1 test-short(Windows PowerShell);make lintbefore you call it done - Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md
Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: S. audit-key: performance|internal/walk/walk.go|looksBinary
- Vorherrschende Sprache
- Go
- Sterne
- 0
- Forks
- 1
- Ø Merge
- 8 Std. 14 Min.
- Gemergte PRs (30 T.)
- 3
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TMHSDigital/Spackle
-
ci good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
TMHSDigital/Spackle#206 ·
Maintainer antworten meist innerhalb von 1 Tag
-
ci severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TMHSDigital/Spackle#205 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
TMHSDigital/Spackle#199 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 87/100
TMHSDigital/Spackle#195 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation good first issue severity: medium
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
TMHSDigital/Spackle#188 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in TMHSDigital/Spackle
Ähnliche Issues
-
bug effort:s impact:med raised-by:worker risk:low to:worker
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
medici-finance/assay#8120 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
factory:subtask
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
agent-substrate/substrate#4308 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
celestiaorg/celestia-app#8877 ·
Maintainer antworten meist innerhalb von 1 Tag
-
sweep
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
bketelsen/truenas-mcp#112 ·
Maintainer antworten meist innerhalb von 1 Tag