🏴☠️
This file contains hidden or 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
const Benchmark = require('benchmark') | |
const Bl = require('./') | |
const smallBuffers = new Bl(new Array(100).fill(1).map(() => Buffer.alloc(8, 1))) | |
const largeBuffers = new Bl(new Array(100).fill(1).map(() => Buffer.alloc(1024, 1))) | |
const mixedBuffers = new Bl(new Array(100).fill(1).map((val, i) => Buffer.alloc(i ** 2 % 1024, 1))) | |
const veryLargeBuffers = new Bl(new Array(100).fill(1).map(() => Buffer.alloc(1024 * 1024, 1))) | |
const notFindableSmall = Buffer.alloc(7, 0) | |
const notFindableMedium = Buffer.alloc(510, 0) |
This file contains hidden or 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
#!/usr/bin/env node | |
const r2 = require('r2'); | |
const API_HOST = 'https://api.github.com/graphql'; | |
const PUBLIC_READ_TOKEN = 'XXX'; // (only needs public repo scope) | |
const query = ` | |
query { | |
repository(owner: "node-serialport", name: "node-serialport") { | |
nameWithOwner | |
owner { |
This file contains hidden or 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
license: gpl-3.0 |
This file contains hidden or 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
{ | |
"Image": { | |
"3900284": [ | |
"No validator for Image 'o:HasMedia': 1" | |
], | |
"3900287": [ | |
"No validator for Image 'o:HasMedia': 1" | |
], | |
"3900290": [ | |
"No validator for Image 'o:HasMedia': 1" |
This file contains hidden or 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
{ | |
"FeatureZone": { | |
"2481425": [ | |
"count === 1 failed with 2 for 's:HasClip'" | |
], | |
"3077671": [ | |
"count === 1 failed with 0 for 's:HasClip'" | |
], | |
"3206466": [ | |
"count === 1 failed with 2 for 's:HasClip'" |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
{ | |
"2": 1446852245925, | |
"3": 1446852245925, | |
"4": 1446852245924, | |
"5": 1446852245924, | |
"6": 1446852245924, | |
"7": 1446852245924, | |
"8": 1446852245924, | |
"9": 1446852245924, | |
"10": 1446852245923, |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
{ | |
"2": 1446852245925, | |
"3": 1446852245925, | |
"4": 1446852245924, | |
"5": 1446852245924, | |
"6": 1446852245924, | |
"7": 1446852245924, | |
"8": 1446852245924, | |
"9": 1446852245924, | |
"10": 1446852245923, |
This file contains hidden or 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
function decodeHexEscape(str) { | |
return str.replace(/\\x([a-fA-F0-9]{2})/g, (a, b) => { | |
return String.fromCharCode(parseInt(b, 16)); | |
}); | |
} |
This file contains hidden or 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
const fs = require('fs') | |
const Promise = require('bluebird') | |
const moment = require('moment') | |
const { promisify } = require('util') | |
const touch = promisify(require('touch')) | |
var getExifData = promisify(require('exif').ExifImage) | |
const readdir = promisify(fs.readdir) | |
const stat = promisify(fs.stat) |
This file contains hidden or 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
★ thunk-redis git:(master) ✗ node benchmark | |
redis(redis): node_redis OK | |
redis(thunk-redis):thunk-redis OK | |
redis(ioredis): ioRedis OK | |
Bench start:(100000) | |
PING concurrency(full thread): | |
redis(redis): 1058ms 94517ops/sec 100% | |
redis(thunk-redis): 1117ms 89525ops/sec 94.7% |