insert count x 1.000.000 | 4 bytes uint | 5 bytes uint | 6 bytes uint |
---|---|---|---|
0.1 | 3 | 0 | 0 |
1 | 130 | 1 | 0 |
2 | 500 | 5 | 0 |
3 | 1000 | 9 | 0 |
4 | 2000 | 18 | 0 |
5 | 3000 | 30 | 0 |
6 | 4200 | 41 | 0 |
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
class R<P,S> { | |
state:S; | |
props:P; | |
static instance; | |
refs:{ [ref: string]: React.ReactComponent<any, any>; }; | |
getDOMNode():Element { | |
return null | |
} |
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
var name = ''; | |
if (node.expression.text === 'Atom'){ | |
var exps = []; | |
var n = node; | |
var ns = []; | |
var isReturn = false; | |
var isThis = false; | |
var ex = false; | |
while (n = n.parent){ | |
if (n.name && n.kind !== 128){ |
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
function emitMemberFunctions(node) { | |
ts.forEach(node.members, function (member) { | |
//console.log(member.kind, member); | |
if (member.kind === 126){ | |
writeLine(); | |
emitStart(member); | |
write("Object.defineProperty("); | |
emitStart(member.name); | |
emitNode(node.name); | |
var memberName = member.name.text; |
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
function atomExpression(node){ | |
var name = ''; | |
var atomNames = 'Atom|AtomFormula|List|ListFormula'; | |
if (atomNames.indexOf(node.expression.text) > -1){ | |
var exps = []; | |
var n = node; | |
var ns = []; | |
var isReturn = false; | |
var isThis = false; |
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
function emitMemberFunctions(node) { | |
ts.forEach(node.members, function (member) { | |
if (member.kind === 126){ | |
writeLine(); | |
emitStart(member); | |
var memberName = member.name.text; | |
var owner = node.name.text; | |
var ownerName = node.name.text; | |
if (!(member.flags & 128 /* Static */)) { | |
owner = 'this'; |
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
function emitMemberFunctions(node) { | |
ts.forEach(node.members, function (member) { | |
if (member.kind === 126){ | |
var par = member.parent; | |
while(par.parent && (par = par.parent)); | |
var txt = par.text.substr(member.pos, member.end).trim(); | |
var observable = '//@observable'; | |
if (txt.substr(0, observable.length) !== observable) | |
return; | |
writeLine(); |
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
function emitConstructorOfClass() { | |
var saveTempCount = tempCount; | |
var saveTempVariables = tempVariables; | |
var saveTempParameters = tempParameters; | |
tempCount = 0; | |
tempVariables = undefined; | |
tempParameters = undefined; | |
ts.forEach(node.members, function (member) { | |
if (member.kind === 129 /* Constructor */ && !member.body) { |
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
var tests = [ | |
[[], [1, 2, 3], [1, 2, 3], [], 0, 0], | |
[[1, 2, 3], [], [], [1, 2, 3], 0, 0], | |
[[1, 2, 3], [1, 2, 3], [], [], 3, 0], | |
[[1, 2, 3, 4], [1, 2, 3], [], [4], 3, 0], | |
[[1, 2, 3], [1, 2, 3, 4], [4], [], 3, 0], | |
[[1, 2, 3], [1, 3], [], [2], 3, 1], | |
[[1, 3], [1, 2, 3], [2], [], 3, 0], | |
[[1, 2, 3], [3, 2, 1], [], [], 6, 0], | |
[[1, 2, 3], [3, 2], [], [1], 5, 2], |
create package.js
npm init -y
create tsconfig.json
tsc --init
install deps
OlderNewer