Skip to content

Instantly share code, notes, and snippets.

@DerekZiemba
DerekZiemba / index.html
Last active February 23, 2024 22:57 — forked from Spyryto/index.html
Loop Performance 2 .jsbench (https://jsbench.github.io/#e86c06909d7eedd18f8b9bac101e9d6d) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Loop Performance 2 .jsbench</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>
@DerekZiemba
DerekZiemba / index.html
Last active November 17, 2016 01:06
Finding elements off cached selector speed (http://jsbench.github.io/#002bcf9243e6c097a07ede2ee2c789e1) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Finding elements off cached selector speed</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="./suite.js"></script>
@DerekZiemba
DerekZiemba / index.html
Last active January 19, 2021 18:54
For-Each Compact Performance.jsbench (http://jsbench.github.io/#87313123406b8ba610e86e4a79088f2c) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>For-Each Compact Performance.jsbench</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>
@DerekZiemba
DerekZiemba / index.html
Created March 9, 2017 21:40
Loop Performance2 Different Order .jsbench (http://jsbench.github.io/#785b8f08d2eaef25b16831460472ea94) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Loop Performance .jsbench</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>Loop Performance .jsbench</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
function getLevenshteinDistance(a, b) {
var tmp;
if (a.length === 0) { return b.length; }
if (b.length === 0) { return a.length; }
if (a.length > b.length) { tmp = a; a = b; b = tmp; }
var i, j, res, alen = a.length, blen = b.length, row = Array(alen);
for (i = 0; i <= alen; i++) { row[i] = i; }
@DerekZiemba
DerekZiemba / LoopPerfStolenArr.html
Last active April 25, 2017 17:40
Loop Performance with Array stolen from iframe (http://jsbench.github.io/#7742b2ad4c06dcfe1799f819da197cdc) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Loop Performance with Array stolen from iframe</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>
@DerekZiemba
DerekZiemba / index.html
Last active March 13, 2020 23:56
ES6 Classes vs Closures vs ES5 "Classes" (http://jsbench.github.io/#b5d3ec32e4fae1606cafae8f309659aa) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>ES6 Classes vs Closures vs ES5 "Classes"</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>
@DerekZiemba
DerekZiemba / index.html
Last active February 4, 2020 01:39
Fastest way to convert arguments to array (https://jsbench.github.io/#23acc7fe843ce3d2cf009ed0cec10428) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Fastest way to convert arguments to array</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>
@DerekZiemba
DerekZiemba / index.html
Last active March 9, 2018 11:42
Fastest method to slice arguments at index 2 (https://jsbench.github.io/#e68458777bae1f89c06b8ff325c7e67a) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Fastest method to slice arguments at index 2</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>