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 sqlite = require('sqlite'); | |
const msgpack = require('msgpack-lite'); | |
const fs = require('fs'); | |
const pathlib = require('path'); | |
const zoneToFilename = (zone) => zone.replace(/[^\p{L}\p{N}_\-]+/gu, '') || '_'; | |
const separator = '\x1f'; | |
const mangle = (key) => { | |
if (typeof key === 'string') return key + separator; | |
else return key.join(separator) + separator; | |
}; |
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
let msgpackLite = require('msgpack-lite'); | |
let borc = require('borc'); | |
let _ = require('lodash'); | |
let { performance } = require('perf_hooks') | |
let arrays = _.times(100, (n) => { | |
return _.times(n, i => _.random(10000, 99999, false)) | |
}); | |
let encodedBORC = arrays.map(array => borc.encode(array)); |
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 () { | |
var array1, array2, array3, array4, gen, y, x; | |
array1 = [50, 30, 70, 20]; | |
var obj = { | |
idx: 0, | |
next: function() { | |
if (obj.idx >= array1.length) { | |
return { done: true }; | |
} |
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 () { | |
var array1, array2, array3, array4, gen, iterator, x; | |
array1 = [50, 30, 70, 20]; | |
gen = function*() { | |
return (yield* array1); | |
}; | |
array2 = []; | |
array3 = []; | |
array4 = []; | |
iterator = gen(); |
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
/* | |
on my machine: | |
es3 50000095000000 1085 ms | |
es5 50000095000000 11037 ms | |
es6 50000095000000 910 ms | |
es3 50000095000000 1100 ms | |
es5 50000095000000 11640 ms | |
es6 50000095000000 876 ms | |
*/ |
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
a-̧̀ŝ̖ü͈p̩̥̿̾ề̫̻ŕ͈̪́i̡̩̔̀ó̪̙̅r̛͕̭̈́-̣̮̯̼̤̱̗͗̆̍̿͛̕̕̚͘͜͜c͚̼͉̠͚̘͚̍͗̐̈́̾̑͜͜͠͝͠u̫͙̤̥͖̠̻̲͓͊̌̓̂̎̉̉̓͝ĺ̛̠̘͉̠̩̬̝̰̣̔̆̇̓̒̑̉t̜̼͍͉̜̙̤̫͊̅̎́͂͛̄̑͝ͅ- |
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
~~ bool ~~ | |
bool#type(object) -> the object's type | |
bool#str(object='') -> str | |
bool#from_bytes(bytes, byteorder, *, signed=False) -> int | |
bool#to_bytes(length, byteorder, *, signed=False) -> bytes | |
~~ bytearray ~~ | |
bytearray#type(object) -> the object's type | |
bytearray#str(object='') -> str | |
bytearray#center(width[, fillchar]) -> copy of B | |
bytearray#count(sub[, start[, end]]) -> int |
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
~~ bool ~~ | |
bool#type(object) -> the object's type | |
bool#str(object='') -> str | |
bool#from_bytes(bytes, byteorder, *, signed=False) -> int | |
bool#to_bytes(length, byteorder, *, signed=False) -> bytes | |
~~ bytearray ~~ | |
bytearray#type(object) -> the object's type | |
bytearray#str(object='') -> str | |
bytearray#center(width[, fillchar]) -> copy of B | |
bytearray#count(sub[, start[, end]]) -> int |
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
_ = require 'lodash' | |
{Tokenizer} = require './tokenize' | |
last = _.last | |
# There's two varieties of data structures: 'vals' and 'val' | |
# 'vals' is a branch node that contains many direct children | |
# 'val' is a leaf node that has no direct children | |
makeVals = (kind, vals) -> { kind: kind, vals: vals } |
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
=~- Happened 7 times -~= | |
======================== | |
== e748173eb77c76cfcb1c983070ac | |
-- | |
objc_retain | |
=~- Happened 6 times -~= | |
======================== | |
== bf90131940ccdc80edc3e54e26ef |
NewerOlder