Skip to content

Instantly share code, notes, and snippets.

@milahu
milahu / brave-browser-is-spyware.md
Created March 22, 2022 07:16
brave browser is spyware? yes.
@milahu
milahu / index.html
Last active June 2, 2021 20:28
get last item / key / value in map #jsbench #jsperf (https://jsbench.github.io/#7992a793df12b1ee16beaef7a9863c68) #jsbench #jsperf
<!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 April 6, 2021 06:26 — forked from jridgewell/index.html
trace sourcemap: binary search vs cache array / object / map / flat map (https://jsbench.github.io/#cf2b815df12f6fc912afd58aba934d84) #jsbench #jsperf
<!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>
@milahu
milahu / index.html
Last active January 5, 2021 00:17
count number of lines in string (http://jsbench.github.io/#4cc806b4507ae063efc81900cdfb9b02) #jsbench #jsperf
<!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>
@milahu
milahu / index.html
Last active December 18, 2020 15:24
unswitch for loop #jsbench #jsperf (https://jsbench.github.io/#ad362c5589fab6e17498939f5343310d) #jsbench #jsperf
<!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>
@milahu
milahu / index.html
Created December 17, 2020 18:08
native sort vs JS sort (https://jsbench.github.io/#c90f8f13202ce5498f811ff79fb281ed) #jsbench #jsperf
<!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 / sveltePreval.js
Last active November 22, 2020 12:17
preval for svelte
// moved to https://github.com/milahu/svelte-preval
/*
preval for svelte
code is at line 250 :P
performant:
eval static expressions at compile time
@milahu
milahu / index.html
Last active October 10, 2020 08:23
binary search vs biased binary search (optimized for sequential search) #jsbench #jsperf (http://jsbench.github.io/#24ecbbbc5d760eb771f776b227d8c36b) #jsbench #jsperf
<!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 October 7, 2020 06:37
test if type is string (http://jsbench.github.io/#9ea2f56bba30fed35f1b5f2b22954d4e) #jsbench #jsperf
<!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>
<!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>