-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
146 additions
and
52 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
# benchmarks |
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const {EventStoreDBClient} = require("@eventstore/db-client"); | ||
const {Bench, hrtimeNow} = require("tinybench"); | ||
|
||
(async () => { | ||
const streamName = "my_stream_10_000"; | ||
let client = null; | ||
|
||
const bench = new Bench({ | ||
name: 'EventStoreDB client (v6.2.1)', | ||
now: hrtimeNow, | ||
warmupIterations: 1, | ||
iterations: 20, | ||
setup: async () => { | ||
if (global.gc) { | ||
global.gc(); | ||
await new Promise((r) => setTimeout(r, 5000)); | ||
} | ||
|
||
client = EventStoreDBClient.connectionString`esdb://localhost:2113?tls=false` | ||
} | ||
}) | ||
|
||
let i = 0; | ||
|
||
bench | ||
.add('readStream', async () => { | ||
const stream = client.readStream(streamName, { | ||
maxCount: 10_000n | ||
}); | ||
|
||
for await (const {event} of stream) { | ||
i += event.commitPosition; | ||
} | ||
}) | ||
|
||
await bench.run() | ||
|
||
console.log(bench.name) | ||
console.table( | ||
bench.tasks.map(({name, result}) => ({ | ||
"Task Name": name, | ||
"Average Time (ms)": result.mean, | ||
"Samples": result.samples.length, | ||
})) | ||
); | ||
})() | ||
|
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const {KurrentDBClient} = require("@kurrent/db-client"); | ||
const {Bench, hrtimeNow} = require("tinybench"); | ||
|
||
// ignore warning messages | ||
console.warn = () => {}; | ||
|
||
(async () => { | ||
const streamName = "my_stream_10_000"; | ||
let client = null; | ||
|
||
const bench = new Bench({ | ||
name: 'KurrentDB Client (v1.0.0-alpha.0)', | ||
now: hrtimeNow, | ||
warmupIterations: 1, | ||
iterations: 20, | ||
setup: async () => { | ||
if (global.gc) { | ||
global.gc(); | ||
await new Promise((r) => setTimeout(r, 5000)); | ||
} | ||
|
||
client = KurrentDBClient.connectionString`esdb://localhost:2113?tls=false` | ||
} | ||
}) | ||
|
||
let i = 0; | ||
|
||
bench | ||
.add('readStream', async () => { | ||
const stream = client.readStream(streamName, {maxCount: 10_000n}); | ||
|
||
for await (const resolved of stream) | ||
i += resolved.commitPosition; | ||
}) | ||
|
||
await bench.run() | ||
|
||
console.log(bench.name) | ||
console.table( | ||
bench.tasks.map(({name, result}) => ({ | ||
"Task Name": name, | ||
"Average Time (ms)": result.mean, | ||
"Samples": result.samples.length, | ||
})) | ||
); | ||
})() | ||
|
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "benchmark", | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"benchmark": "yarn benchmark:eventstoreClient && yarn benchmark:kurrentClient && yarn benchmark:bridge", | ||
"benchmark:eventstoreClient": "node ./eventstoreClient/readStream.js", | ||
"benchmark:kurrentClient": "node ./kurrentClient/readStream.js", | ||
"benchmark:bridge": "node ./bridge/readStream.js", | ||
"loadEvents": "node ./load" | ||
}, | ||
"dependencies": { | ||
"@eventstore/db-client": "^6.2.1", | ||
"tinybench": "^3.1.1" | ||
}, | ||
"devDependencies": { | ||
"@kurrent/db-client": "workspace:^", | ||
"@kurrent/db-client-bridge": "workspace:^", | ||
"clinic": "^13.0.0" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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