You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Artifact discovery reads every non-Go file whole into memory #66
Describe the bug readArtifact calls os.ReadFile on every non-.go file to hash it and to test it for UTF-8. It does this also when --artifact-text is off, on cache hits, and on -t runs. It walks node_modules, .venv and large binaries.
To Reproduce
Put a 1 GB binary file in a project.
Run cango -i . -a 1 and measure the peak memory.
Expected behavior
Discovery hashes each file as a stream, in constant memory. It reads the full text only when --artifact-text is set.
Logs
Measured on the old code: a 1 GB binary in the tree peaked at 1.09 GB resident. The same tree without it peaked at 27 MB.
Fixed in PR #55 (d2ae0e4): discovery hashes each file as a stream in constant memory and reads the full text only with --artifact-text. A 1 GB file now peaks at 27.8 MB, against 1.09 GB before.
Activity
rahlk commentedon Nov 29, 2026
Fixed in PR #55 (
d2ae0e4): discovery hashes each file as a stream in constant memory and reads the full text only with--artifact-text. A 1 GB file now peaks at 27.8 MB, against 1.09 GB before.