Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jun 30, 2013
@mcollina writeStream benchmark. f70a410
Showing with 44 additions and 1 deletion.
  1. +39 −0 benchmarks/writeStream.js
  2. +5 −1 benchmarks/writes.js
View
39 benchmarks/writeStream.js
@@ -0,0 +1,39 @@
+var level = require("level-test")()
+ , levelgraph = require("../")
+
+ , db = levelgraph(level())
+
+ , startCounts = 10000
+ , counts = startCounts
+
+ , startTime = new Date()
+ , endTime
+
+ , stream = db.putStream()
+
+ , doBench = function() {
+
+ if(--counts === 0) {
+ endTime = new Date();
+ var totalTime = endTime - startTime;
+ console.log("total time", totalTime);
+ console.log("writes/s", startCounts / totalTime * 1000);
+ console.log('Memory usage', Math.round(process.memoryUsage().rss / 1024 / 1024), 'MB');
+ return;
+ }
+
+ var triple = {
+ subject: "s" + counts,
+ predicate: "p" + counts,
+ object: "o" + counts
+ };
+
+ stream.write(triple);
+ if (counts % 100 === 0) {
+ setImmediate(doBench);
+ } else {
+ doBench();
+ }
+ };
+
+doBench();
View
6 benchmarks/writes.js
@@ -4,18 +4,22 @@ var level = require("level-test")()
, db = levelgraph(level())
- , startCounts = 100000
+ , startCounts = 16777216
, counts = startCounts
, startTime = new Date()
, endTime
, doBench = function() {
+ if(counts % 10000 === 0) {
+ console.log(counts);
+ }
if(--counts === 0) {
endTime = new Date();
var totalTime = endTime - startTime;
console.log("total time", totalTime);
console.log("writes/s", startCounts / totalTime * 1000);
+ console.log('Memory usage', Math.round(process.memoryUsage().rss / 1024 / 1024), 'MB');
return;
}

No commit comments for this range

Something went wrong with that request. Please try again.