📌 Description
The bulk export pipeline streams NDJSON/gzip, but there is no benchmark
asserting it holds a bounded memory ceiling under backpressure (a slow
client) and that chunk sizing is tuned for throughput. An unbounded buffer here
would let one large export OOM the process.
This issue adds a streaming benchmark asserting bounded memory under
backpressure and measuring throughput across chunk sizes.
Goal: prove export streaming stays within a memory ceiling under a slow
consumer and document the throughput-optimal chunk size.
🎯 Requirements and Context
- Must simulate a slow consumer and assert peak memory stays bounded.
- Must measure throughput across chunk sizes and record the chosen value.
- Must verify gzip and NDJSON framing remain correct under chunking.
- Must run with
bun test.
🛠️ Suggested Execution
1. Fork the repo and create a branch
git checkout -b perf/export-stream-backpressure
2. Implement changes
- Add
src/tests/performance/exportStream.perf.test.ts exercising
src/services/exportQueue.ts/src/routes/exports.ts.
- Document the chunk-size choice in
docs/exports.md.
3. Test and commit
- Run with
bun test.
- Cover edge cases: slow consumer memory ceiling, large dataset, gzip framing,
abort mid-stream.
Example commit message
perf: backpressure-aware export streaming memory benchmark
✅ Guidelines
- Minimum 95% test coverage on the new/changed lines.
- Clear, reviewer-friendly documentation.
- No regressions on existing export streaming.
- Timeframe: 96 hours.
🏷️ Labels
type-performance · area-backend · type-testing · MAYBE REWARDED · GRANTFOX OSS · OFFICIAL CAMPAIGN
💬 Community & Support
- Join the Disciplr contributor Discord to coordinate, ask questions, and get
unblocked fast: https://discord.gg/xvNAvMJf
- Please introduce yourself in the channel before you start so we can avoid
duplicate work, pair you with a reviewer, and get your PR merged quickly.
- Maintainers actively triage this channel and aim for fast, clear, respectful
reviews — reach out any time you're blocked.
📌 Description
The bulk export pipeline streams NDJSON/gzip, but there is no benchmark
asserting it holds a bounded memory ceiling under backpressure (a slow
client) and that chunk sizing is tuned for throughput. An unbounded buffer here
would let one large export OOM the process.
This issue adds a streaming benchmark asserting bounded memory under
backpressure and measuring throughput across chunk sizes.
🎯 Requirements and Context
bun test.🛠️ Suggested Execution
1. Fork the repo and create a branch
2. Implement changes
src/tests/performance/exportStream.perf.test.tsexercisingsrc/services/exportQueue.ts/src/routes/exports.ts.docs/exports.md.3. Test and commit
bun test.abort mid-stream.
Example commit message
✅ Guidelines
🏷️ Labels
type-performance·area-backend·type-testing·MAYBE REWARDED·GRANTFOX OSS·OFFICIAL CAMPAIGN💬 Community & Support
unblocked fast: https://discord.gg/xvNAvMJf
duplicate work, pair you with a reviewer, and get your PR merged quickly.
reviews — reach out any time you're blocked.