Replies: 1 comment
-
We have made a lot of performance enhancements in v3 and I would expect that this has improved quite a bit if you tried similar benchmarking against latest. That said, there are major differences between fetching from mongodb directly and I'm not surprised that there is a time difference between these two. The Payload find operation will get the document which will have the With the way the dataloader pattern works it matters if you're populating the same doc in multiple places or getting different docs 1000 times. I'd be curious what kind of perf you see in v3 and especially if you make use of defaultPopulate and other new features for perf improvements. I'm converting this to a discussion and if there are fixes that come out of this conversation we can create new issues for those action items. |
Beta Was this translation helpful? Give feedback.
-
Link to reproduction
No response
Describe the Bug
I am experiencing a significant performance issue when using Payload CMS's payload.find to fetch news documents that include populated fields (category, subcategory).
This issue becomes a major bottleneck when handling large datasets.
Expected Behavior:
Fetching populated data using payload.find should perform similarly to Mongoose's find().populate(), rather than being 15x slower.
Actual Behavior:
Environment:
To Reproduce
- category (reference to a category collection)
- subcategory (reference to a subcategory collection)
const result = await payload.find({ collection: 'news', limit: 1000, depth: 2, });
const result = await payload.db.collections["news"] .limit(1000) .populate('category') .populate('subcategory');
Payload Version
2.30.0
Adapters and Plugins
db-mongodb
Screenshots
Beta Was this translation helpful? Give feedback.
All reactions