Skip to content

Instantly share code, notes, and snippets.

View jridgewell's full-sized avatar
😬

Justin Ridgewell jridgewell

😬
  • New York, NY
  • 14:48 (UTC -04:00)
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>TextEncoder vs charCodeAt</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@jridgewell
jridgewell / index.html
Created March 18, 2021 20:59
Stable sorting #jsbench #jsperf (https://jsbench.github.io/#f32d70e88170ab4e165ac1f7f30df163) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Stable sorting #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>https://twitter.com/fenomas/status/1364927834901291011 #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@jridgewell
jridgewell / index.html
Last active March 1, 2024 05:54
Rest-Spread vs Rest-Apply vs Arguments-Spread vs Arguments-Apply (https://jsbench.github.io/#d18c13bd3feb7bfa18a02ef6fa46fc40) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Rest-Spread vs Rest-Apply vs Arguments-Spread vs Arguments-Apply</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@jridgewell
jridgewell / index.html
Last active February 10, 2021 00:36
HTML Entity Encoding / Escapement #jsbench #jsperf (https://jsbench.github.io/#62ffe7cc62fe8913ef4c89991e034169) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>HTML Entity Encoding / Escapement #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@jridgewell
jridgewell / index.html
Created February 2, 2021 09:29
createElement vs createElementNS (https://jsbench.github.io/#f582e3f3a8cf8d94f9b64f2c65146fe4) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>createElement vs createElementNS</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@jridgewell
jridgewell / index.html
Created November 1, 2020 09:15
createElement vs createElementNS (https://jsbench.github.io/#9adaab1aa39df377a8fa9bd067cddb98) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>createElement vs createElementNS</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@jridgewell
jridgewell / sort-imports.js
Last active October 30, 2020 03:13
Sort imports by source location, prioritizing external, sibling, then parents
module.exports = {
create(context) {
const imports = [];
const source = context.getSourceCode();
function sorter(a, b) {
const l = Math.max(a.length, b.length);
for (let i = 0; i < l; i += 1) {
if (a[i] === '.' && b[i] !== '.' && b[i] !== '..') return +1;
if (b[i] === '.' && a[i] !== '.' && a[i] !== '..') return -1;
@jridgewell
jridgewell / index.html
Last active October 23, 2020 20:02
Does deleting __proto__ hurt perf? (Run twice to work) (https://jsbench.github.io/#82502a933953f589e1c23ce5af88f6e4) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Does deleting __proto__ hurt perf? (Run twice to work)</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@jridgewell
jridgewell / index.html
Created October 15, 2020 20:11
Object.create vs __proto__ syntax for null prototype #jsbench #jsperf (https://jsbench.github.io/#d3ff614bded8bf46cf91df5b898faba1) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Object.create vs __proto__ syntax for null prototype #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>