Skip to content

perf(storage): load the Azure and GCS SDKs only when selected - #21

Closed
chenrui333 wants to merge 1 commit into
review-base/upstream-devfrom
perf/lazy-storage-sdks
Closed

chenrui333 wants to merge 1 commit into
review-base/upstream-devfrom
perf/lazy-storage-sdks

Conversation

@chenrui333

@chenrui333 chenrui333 commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Review copy of a proposed upstream change, based on falcondev-oss/github-actions-cache-server@dev (6ae06c2). Upstream accepts pull requests from collaborators only, so this branch is offered through an upstream issue.

lib/storage.ts imports @azure/storage-blob, @azure/identity and @google-cloud/storage at the top level, so every server loads all three SDKs whatever STORAGE_DRIVER is. Since the Azure Blob driver (falcondev-oss#280) that adds ~40 MB of live heap to an idle S3/filesystem server (nodejs_heap_size_used_bytes after startup: 109 MB on dev, 68 MB with this change), and every GC cycle walks it.

On streaming paths that shows up as CPU. Measured on a 9.9.0-based build (with the other changes from falcondev-oss#292–falcondev-oss#294), cold first restores of unmerged entries on S3 (RustFS, SQLite, one worker, real RS256 token validation, 3 interleaved reps) cost 0.096 CPU-s per hit with the eager imports vs 0.0835 with lazy imports (−13%), back to 9.8.0-level (0.0831).

Each SDK is now imported inside its adapter's fromEnv; only types stay static. pnpm test:run passes for filesystem, azblob and gcs.

`lib/storage.ts` imported `@azure/storage-blob`, `@azure/identity` and
`@google-cloud/storage` at the top level, so every server loaded all three
SDKs whatever `STORAGE_DRIVER` said. Since the Azure Blob driver (falcondev-oss#280) that
adds about 40 MB of live heap to an idle S3 or filesystem server, and every
GC cycle has to walk it.

Import each SDK inside its adapter's `fromEnv`; only types stay as static
imports.

Signed-off-by: Rui Chen <rui@chenrui.dev>
@chenrui333

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T22:46:56.623171Z 00a7d6c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 00a7d6cb3f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chenrui333

Copy link
Copy Markdown
Owner Author

Superseded by upstream v9.10.0 (falcondev-oss#296).

@chenrui333 chenrui333 closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant