Listing and seeding repeat per-file work (binary sniff, YAML parse, stat)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 55/100
- Type d'issue
- Refactorisation
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- go, yaml
- Domaine
- cli, performance
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Go
- Étoiles
- 0
- Forks
- 1
- Merge moyen
- 8 h 14 min
- PR mergées (30 j)
- 3
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de TMHSDigital/Spackle
-
ci good first issue severity: low
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
TMHSDigital/Spackle#206 ·
Les mainteneurs répondent en général sous 1 jour
-
ci severity: low
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
TMHSDigital/Spackle#205 ·
Les mainteneurs répondent en général sous 1 jour
-
bug good first issue severity: low
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
TMHSDigital/Spackle#199 ·
Les mainteneurs répondent en général sous 1 jour
-
bug good first issue severity: low
Difficulté 2/5 1-3 heures Accessibilité débutants 87/100
TMHSDigital/Spackle#195 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation good first issue severity: medium
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
TMHSDigital/Spackle#188 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de TMHSDigital/Spackle
Issues similaires
-
deskclose human-decided leaves the legacy decision-needed label and applies no human-decidedOuvertebug effort:s impact:med raised-by:worker risk:low to:worker
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
medici-finance/assay#8120 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
factory:subtask
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
agent-substrate/substrate#4308 ·
Les mainteneurs répondent en général sous 2 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
celestiaorg/celestia-app#8877 ·
Les mainteneurs répondent en général sous 1 jour
-
sweep
Difficulté 1/5 Moins d'une heure Accessibilité débutants 84/100
bketelsen/truenas-mcp#112 ·
Les mainteneurs répondent en général sous 1 jour