Skip to content

Instantly share code, notes, and snippets.

View joshpowlison's full-sized avatar
💭
Setting my status

Josh Powlison joshpowlison

💭
Setting my status
View GitHub Profile
@joshpowlison
joshpowlison / index.html
Last active January 17, 2020 10:56
Large sets of .indexOf run slower than regex .test? #jsbench #jsperf (http://jsbench.github.io/#8a0c2f5baba00c4b49e4008f70e91228) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Large sets of .indexOf run slower than regex .test? #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>
@joshpowlison
joshpowlison / index.html
Last active December 30, 2017 23:27
Setting a variable in a check makes .test faster than .indexOf (http://jsbench.github.io/#994cc25867f34646dcfbbddf9257c8ff) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Setting a variable in a check makes .test faster than .indexOf</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>