Skip to content

Commit

Permalink
removed: extraneous testing
Browse files Browse the repository at this point in the history
added: more detailed benchmark names
  • Loading branch information
iuioiua committed Jul 5, 2022
1 parent de2b6cd commit 73cf957
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 465 deletions.
23 changes: 6 additions & 17 deletions bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ const redis = await connect({
port: 6379,
});

/**
* PING
*/

Deno.bench({
name: "r2d2",
name: "r2d2: PING",
group: "PING",
baseline: true,
async fn() {
Expand All @@ -23,19 +19,15 @@ Deno.bench({
});

Deno.bench({
name: "deno-redis",
name: "deno-redis: PING",
group: "PING",
async fn() {
await redis.ping();
},
});

/**
* SET and GET
*/

Deno.bench({
name: "r2d2",
name: "r2d2: SET and GET",
group: "SET and GET",
baseline: true,
async fn() {
Expand All @@ -45,19 +37,16 @@ Deno.bench({
});

Deno.bench({
name: "deno-redis",
name: "deno-redis: SET and GET",
group: "SET and GET",
async fn() {
await redis.sendCommand("SET", "mykey", "Hello");
await redis.sendCommand("GET", "mykey");
},
});

/**
* MSET and MGET
*/
Deno.bench({
name: "r2d2",
name: "r2d2: MSET and MGET",
group: "MSET and MGET",
baseline: true,
async fn() {
Expand All @@ -67,7 +56,7 @@ Deno.bench({
});

Deno.bench({
name: "deno-redis",
name: "deno-redis: MSET and MGET",
group: "MSET and MGET",
async fn() {
await redis.mset({ a: "foo", b: "bar" });
Expand Down
8 changes: 1 addition & 7 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ export { BufReader } from "https://deno.land/std@0.146.0/io/buffer.ts";
export { TextProtoReader } from "https://deno.land/std@0.146.0/textproto/mod.ts";

/** Testing */
export {
afterAll,
beforeAll,
beforeEach,
it,
} from "https://deno.land/std@0.145.0/testing/bdd.ts";
export { delay } from "https://deno.land/std@0.145.0/async/delay.ts";
export { delay } from "https://deno.land/std@0.146.0/async/delay.ts";
export {
assertEquals,
assertRejects,
Expand Down
Loading

0 comments on commit 73cf957

Please sign in to comment.