Skip to content

Instantly share code, notes, and snippets.

@milahu
milahu / index.html
Last active Dec 18, 2020
unswitch for loop #jsbench #jsperf (https://jsbench.github.io/#ad362c5589fab6e17498939f5343310d) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>unswitch for loop #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>
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>native sort vs JS sort</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>
@milahu
milahu / index.html
Last active Jun 2, 2021
get last item / key / value in map #jsbench #jsperf (https://jsbench.github.io/#7992a793df12b1ee16beaef7a9863c68) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>get last item / key / value in map #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>
@milahu
milahu / index.html
Last active Oct 10, 2020
binary search vs biased binary search (optimized for sequential search) #jsbench #jsperf (http://jsbench.github.io/#24ecbbbc5d760eb771f776b227d8c36b) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>binary search vs biased binary search (optimized for sequential search) #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>
@milahu
milahu / index.html
Last active Apr 6, 2021 — forked from jridgewell/index.html
trace sourcemap: binary search vs cache array / object / map / flat map (https://jsbench.github.io/#cf2b815df12f6fc912afd58aba934d84) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>trace sourcemap: binary search vs cache array / object / map / flat map</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>
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>unswitch for loop</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>
@milahu
milahu / index.html
Last active Oct 5, 2020
test if array index exists by value or array length #jsbench #jsperf (http://jsbench.github.io/#8d011d47ee4a1cfda2e94b07ca28d351) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>test if array index exists by value or array length #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>
@milahu
milahu / index.html
Last active Oct 5, 2020
performance of different loop types #jsbench #jsperf (http://jsbench.github.io/#6f65c587af9277325bcda0e69ba44d5f) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>performance of different loop types #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>
@milahu
milahu / index.html
Last active Jan 5, 2021
count number of lines in string (http://jsbench.github.io/#4cc806b4507ae063efc81900cdfb9b02) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>count number of lines in string</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>
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>test if type is string</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>