You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
WIP
This commit is contained in:
20
benchmark/lib/ping/ioredis-auto-pipeline.js
Normal file
20
benchmark/lib/ping/ioredis-auto-pipeline.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import Redis from 'ioredis';
|
||||
|
||||
export default async (host) => {
|
||||
const client = new Redis({
|
||||
host,
|
||||
lazyConnect: true,
|
||||
enableAutoPipelining: true
|
||||
});
|
||||
|
||||
await client.connect();
|
||||
|
||||
return {
|
||||
benchmark() {
|
||||
return client.ping();
|
||||
},
|
||||
teardown() {
|
||||
return client.disconnect();
|
||||
}
|
||||
}
|
||||
};
|
21
benchmark/lib/ping/local-resp2.js
Normal file
21
benchmark/lib/ping/local-resp2.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { createClient } from 'redis-local';
|
||||
|
||||
export default async (host) => {
|
||||
const client = createClient({
|
||||
socket: {
|
||||
host
|
||||
},
|
||||
RESP: 2
|
||||
});
|
||||
|
||||
await client.connect();
|
||||
|
||||
return {
|
||||
benchmark() {
|
||||
return client.ping();
|
||||
},
|
||||
teardown() {
|
||||
return client.disconnect();
|
||||
}
|
||||
};
|
||||
};
|
27
benchmark/lib/ping/local-resp3-module-with-flags.js
Normal file
27
benchmark/lib/ping/local-resp3-module-with-flags.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { createClient } from 'redis-local';
|
||||
import PING from 'redis-local/dist/lib/commands/PING.js';
|
||||
|
||||
export default async (host) => {
|
||||
const client = createClient({
|
||||
socket: {
|
||||
host
|
||||
},
|
||||
RESP: 3,
|
||||
modules: {
|
||||
module: {
|
||||
ping: PING.default
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
await client.connect();
|
||||
|
||||
return {
|
||||
benchmark() {
|
||||
return client.withFlags({}).module.ping();
|
||||
},
|
||||
teardown() {
|
||||
return client.disconnect();
|
||||
}
|
||||
};
|
||||
};
|
27
benchmark/lib/ping/local-resp3-module.js
Normal file
27
benchmark/lib/ping/local-resp3-module.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { createClient } from 'redis-local';
|
||||
import PING from 'redis-local/dist/lib/commands/PING.js';
|
||||
|
||||
export default async (host) => {
|
||||
const client = createClient({
|
||||
socket: {
|
||||
host
|
||||
},
|
||||
RESP: 3,
|
||||
modules: {
|
||||
module: {
|
||||
ping: PING.default
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
await client.connect();
|
||||
|
||||
return {
|
||||
benchmark() {
|
||||
return client.module.ping();
|
||||
},
|
||||
teardown() {
|
||||
return client.disconnect();
|
||||
}
|
||||
};
|
||||
};
|
21
benchmark/lib/ping/local-resp3.js
Normal file
21
benchmark/lib/ping/local-resp3.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { createClient } from 'redis-local';
|
||||
|
||||
export default async (host) => {
|
||||
const client = createClient({
|
||||
socket: {
|
||||
host
|
||||
},
|
||||
RESP: 3
|
||||
});
|
||||
|
||||
await client.connect();
|
||||
|
||||
return {
|
||||
benchmark() {
|
||||
return client.ping();
|
||||
},
|
||||
teardown() {
|
||||
return client.disconnect();
|
||||
}
|
||||
};
|
||||
};
|
@@ -1,4 +1,4 @@
|
||||
import { createClient } from '@redis/client';
|
||||
import { createClient } from 'redis-v4';
|
||||
|
||||
export default async (host) => {
|
||||
const client = createClient({
|
||||
|
Reference in New Issue
Block a user