Skip to content

perf(adapters): fetch Directus and Payload collections concurrently (#12)#141

Merged
i-afaqrashid merged 1 commit into
mainfrom
feat/parallel-cms-fetch
May 29, 2026
Merged

perf(adapters): fetch Directus and Payload collections concurrently (#12)#141
i-afaqrashid merged 1 commit into
mainfrom
feat/parallel-cms-fetch

Conversation

@i-afaqrashid
Copy link
Copy Markdown
Owner

What

Adds mapWithConcurrency to @cms-lab/core (an order-preserving bounded concurrency map) and uses it in the Directus and Payload adapters so their collections are fetched concurrently (pool of 6) instead of sequentially.

  • Pagination within a collection stays sequential.
  • Returned document order is unchanged (collections in config order).

Why

Scans of multi-collection catalogs were serialized on network round-trips. Concurrent collection fetch is the first step of #12.

How verified

  • New core tests: order preserved despite varying delays, concurrency never exceeds the limit, empty list handled.
  • New Directus test: two collections are in flight at once (observed peak = 2) and output order is preserved.
  • Existing single-collection adapter tests unchanged.
  • pnpm verify green (217 tests).

Follow-up: apply the same to the Strapi, WordPress, Contentful, and Sanity adapters.

Refs improvements/12.

)

Adds mapWithConcurrency to @cms-lab/core: an order-preserving bounded
concurrency map. The Directus and Payload adapters now fetch their
collections through it (pool of 6) instead of one after another, so a
scan of a multi-collection catalog is no longer serialized on network
round-trips. Pagination within a collection stays sequential and the
returned document order is unchanged.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cms-lab-site Ready Ready Preview, Comment May 29, 2026 9:18am

@i-afaqrashid i-afaqrashid merged commit 3fd5101 into main May 29, 2026
12 checks passed
@i-afaqrashid i-afaqrashid deleted the feat/parallel-cms-fetch branch May 29, 2026 09:19
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