-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add operator batch() #170
add operator batch() #170
Conversation
@@ -396,9 +400,9 @@ function toPullStream() { | |||
function paginateStream(ops) { | |||
let seq = meta.seq || 0 | |||
let total = Infinity | |||
const limit = meta.pageSize || 1 | |||
const limit = meta.pageSize || meta.batchSize || 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default 1
was actually pretty bad for performance. Reminder: #123 (comment)
Benchmark results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good and is a quite small change in the number of lines.
Very happy we are integrating these best patterns into the library. Feels like next level in a way from fixing bugs :)
Benchmark results
|
For issue #167
Achieved in a non-breaking manner,
paginate()
remains as it is, causing the final pull-stream to emit arrays of messages. We introducebatch()
that has the same performance profile aspaginate()
, but just configure how the results should be streamed: one message at a time, no array of messages.