Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

Added createBatchStream #16

Merged
merged 8 commits into from
Jun 3, 2020
Merged

Added createBatchStream #16

merged 8 commits into from
Jun 3, 2020

Conversation

tinchoz49
Copy link
Contributor

This PR:

  • Adds a new method createBatchStream that works as createReadStream but the chunk returned on('data') is an array with the batch of messages. This feature reduce the time to get data and it can be compare to kappa.
$ browser-runner benchmark.js --timeout 0
# getBatch
ok ~33 ms (0 s + 33280000 ns)

# createReadStream [batch=1]
ok ~4.98 s (4 s + 983534999 ns)

# createReadStream [batch=100]
ok ~91 ms (0 s + 91230001 ns)

# createBatchStream [batch=100]
ok ~48 ms (0 s + 47880001 ns)

wins: getBatch
ok ~40 s (40 s + 81409999 ns)

@tinchoz49 tinchoz49 merged commit ba99b4b into master Jun 3, 2020
@alexwykoff alexwykoff deleted the tinchoz49-create-batch-stream branch November 20, 2020 22:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant