Skip to content

Instantly share code, notes, and snippets.

View justinvdm's full-sized avatar

Justin van der Merwe justinvdm

View GitHub Profile
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>
// !!! 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");
const Benchmark = require("benchmark");
displayIntro()
const N = 1000;
const A = 'a'
const B = 'b'
const C = 'c'
const diff = (() => {
const toString = Function.prototype.toString;
const objectString = toString.call(Object);
return function diff(a, b, opts) {
opts = {
printShallow: false,
...opts,
};
const diff = (() => {
const toString = Function.prototype.toString;
const objectString = toString.call(Object);
return function diff(a, b, opts) {
opts = {
printShallow: false,
...opts,
};
function slowOp(factor) {
const n = 999999 * factor;
let i = -1;
while (++i < n) {
Math.pow(23, i % 3);
}
}
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">
const assert = require("assert");
class V {
constructor(v) {
this.v = v;
}
}
suite("fn-create-overhead", () => {
const { N = 100000 } = require("./conf");
const http = require('http');
const T_CHUNK2 = 10000;
const T_JS = 0;
const a = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
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;