-
-
Save Jmgr/b8f7edc6cd1021bbbcae19806f7895d0 to your computer and use it in GitHub Desktop.
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
let start; | |
const node_redis = require('redis'); | |
const ioredis = require("ioredis"); | |
const args = [ | |
<script sha>, | |
<script arguments...> | |
] | |
const nrClient = node_redis.createClient(<port>, <address>); | |
const ioClient = new ioredis(); | |
const rounds = 100_000; | |
Promise.all([ | |
new Promise(res => nrClient.once('ready', res)), | |
new Promise(res => ioClient.once('ready', res)) | |
]).then(() => { | |
console.log("ready") | |
start = new Date(); | |
for(let i=0; i<rounds; i++) { | |
nrClient.send_command('evalsha', args, () => {}) | |
} | |
console.log("nrclient", new Date() - start) | |
start = new Date(); | |
for(let i=0; i<rounds; i++) { | |
ioClient.send_command('evalsha', args, () => {}) | |
} | |
console.log("ioclient", new Date() - start) | |
process.exit(0) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment