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
const http = require('http'); | |
const markup = ` | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<title>rarily rar rar</title> | |
<script defer src="/head.js"></script> |
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
// !!! NOTE !!! | |
// This is *not* meant to be a comparison to show which library is | |
// universally faster. In fact, it is quite likely that faker and | |
// chance have functions that perform better than the equivalents in | |
// fictional. The 'seed each' benchmarks below are probably also | |
// misuse of faker and chance. The intention of these benchmarks was | |
// to investigate and show why seeding as a way of mapping | |
// identifiers to generated values isn't viable, and why hashing is a | |
// promising solution | |
const Benchmark = require("benchmark"); |
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
const Benchmark = require("benchmark"); | |
displayIntro() | |
const N = 1000; | |
const A = 'a' | |
const B = 'b' | |
const C = 'c' |
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
const diff = (() => { | |
const toString = Function.prototype.toString; | |
const objectString = toString.call(Object); | |
return function diff(a, b, opts) { | |
opts = { | |
printShallow: false, | |
...opts, | |
}; |
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
const diff = (() => { | |
const toString = Function.prototype.toString; | |
const objectString = toString.call(Object); | |
return function diff(a, b, opts) { | |
opts = { | |
printShallow: false, | |
...opts, | |
}; |
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 slowOp(factor) { | |
const n = 999999 * factor; | |
let i = -1; | |
while (++i < n) { | |
Math.pow(23, i % 3); | |
} | |
} | |
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
const http = require("http"); | |
const CSS_DELAY = 5000; | |
const html = ` | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> |
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
const assert = require("assert"); | |
class V { | |
constructor(v) { | |
this.v = v; | |
} | |
} | |
suite("fn-create-overhead", () => { | |
const { N = 100000 } = require("./conf"); |
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
const http = require('http'); | |
const T_CHUNK2 = 10000; | |
const T_JS = 0; | |
const a = ` | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> |
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
const assert = require('assert'); | |
const flowSync = fns => v0 => { | |
let i = -1; | |
let v = v0; | |
const n = fns.length; | |
while (++i < n) v = fns[i](v); | |
return v; |
NewerOlder