Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Buffer writes to the mongodb socket internally.
Previously, writes to the mongodb socket happened immediately. However, this will inevitable overflow the send buffer. So now, we store commands in a buffer and write them out on the next write event window. Inserting 1000+ things still is an edge case where performance suffers, since you'll be memcpy'ing and growing the buffer each time. But at least now it will not segfault.
- Loading branch information
Showing
6 changed files
with
275 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/sh | ||
|
||
node tests/test_bson.js | ||
node tests/test_mongo.js | ||
for f in `ls tests/test_*.js`; do | ||
node $f | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.