Bound concurrent filesystem reads during asset discovery and source ZIP generation
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- cli, performance
Research direction
Read packages/cli/src/util/AssetUploader.ts and packages/cli/src/util/getAppSourceZip.ts, then inspect the existing mapAsyncWithMaxConcurrency() helper. Limit only the filesystem reads to a concurrency such as 16 while preserving traversal, ZIP contents, hashing, ignore rules, ordering, uploads, and output format.
Written by the indexing model from the issue text.
Description
Summary
The Devvit CLI currently performs some filesystem reads with unbounded concurrency. For projects containing large numbers of assets or source files, this can result in hundreds or thousands of simultaneous readFile() operations.
While this is functionally correct, it can unnecessarily increase memory usage, file descriptor pressure, and disk contention.
Current behavior
Two areas currently read files with effectively unbounded concurrency:
-
packages/cli/src/util/AssetUploader.tsqueryAssets()usesPromise.all()to read every asset simultaneously.
-
packages/cli/src/util/getAppSourceZip.ts- Source files are added to the ZIP by launching all file reads at once before awaiting them.
Proposed solution
Reuse the existing mapAsyncWithMaxConcurrency() helper to limit concurrent filesystem reads to a reasonable maximum (for example, 16).
This keeps the implementation consistent with the rest of the repository while:
- reducing peak memory usage
- reducing file descriptor pressure
- improving behavior on slower disks and CI runners
- preserving parallelism
Importantly, this proposal only limits filesystem reads.
It does not change:
- upload concurrency
- ZIP contents
- hashing behavior
- ignore rules
- asset ordering
- output format
Benefits
- Lower peak resource usage
- Better scalability for repositories with many files
- More predictable performance across operating systems
- Minimal implementation risk
Implementation notes
A small, self-contained change would:
- replace the
Promise.all()asset reads inAssetUploader.ts - replace the unbounded ZIP source file reads in
getAppSourceZip.ts - reuse the existing
mapAsyncWithMaxConcurrency()utility - keep directory traversal behavior unchanged
This should be a low-risk performance improvement with no observable behavioral changes.
- Dominant language
- TypeScript
- Stars
- 210
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reddit/devvit
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
newrelic-experimental/preflight#793 · 1 comment ·
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·