Bound concurrent filesystem reads during asset discovery and source ZIP generation

オープン 初心者向け
#278 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
typescript
領域
cli, performance

調査の方向性

packages/cli/src/util/AssetUploader.ts と packages/cli/src/util/getAppSourceZip.ts を読み、続いて既存のヘルパー mapAsyncWithMaxConcurrency() を調べます。ファイルシステムの読み取りだけを、たとえば 16 の並行性に制限し、トラバーサル、ZIP の内容、ハッシュ計算、ignore ルール、順序、アップロード、出力形式を維持します。

索引モデルが issue の本文から書いたものです。

説明

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.ts

    • queryAssets() uses Promise.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 in AssetUploader.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.

主要言語
TypeScript
スター
210
フォーク
88
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

reddit/devvit のほかの issue

reddit/devvit の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。