-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 6.8.0
-
Component/s: Cursors, Performance
Use Case
As a... Node.js driver user
I expect... the performance to remain roughly the same between releases
So that... I get a consistent responsive experience
Reproduction
https://mongodb.slack.com/archives/C03MPA2FY6S/p1721991547262229
import { MongoClient } from 'mongodb'; const client = await MongoClient.connect('mongodb://localhost/'); const cursor = client.db('test').aggregate([ { $documents: [{}] }, { $set: { field: { $reduce: {input: [...Array(20).keys()], initialValue: [0], in: { $concatArrays: ['$$value', '$$value'] } } } } }, { $unwind: '$field' }, { $limit: 1_000_000 } ]); await cursor.toArray() await client.close();
(run with time node test.js).
User Impact
- Cursor iteration is unexpectedly slower
Dependencies
- Cursors, On Demand BSON, Driver Benchmarks
Unknowns
- What is the main bottleneck introduced?
- What is the remedy to the regression?
Acceptance Criteria
Investigation Requirements
- Investigate performance before and after the identified regression commit
- Collect flamegraphs and cpuprofiles for comparing
- Present a theory and suggested patch to the major bottleneck(s)
Implementation Requirements
- TBD, See above.
Testing Requirements
- Investigate the performance alerting system. Did our benchmarks identify this and not warn us? Are we missing a certain kind of benchmark to identify this?
Documentation Requirements
- None
Follow Up Requirements
- None