Skip to content

Instantly share code, notes, and snippets.

Justin Ridgewell jridgewell

Block or report user

Report or block jridgewell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Decoding a SourceMap</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 / benchmark.js
Last active Jul 9, 2019
benchmarking sourcemap-codec
View benchmark.js
const Benchmark = require('benchmark');
const current = require('./current').decode;
const decode = require('./').decode;
const map = JSON.parse(require("fs").readFileSync(
`${__dirname}/dist/sourcemap-codec.umd.js.map`
));
const mappings = map.mappings;
console.log(process.version);
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Decoding a SourceMap</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 May 21, 2019
Creating an TreeWalker, DOM element, and setting a walker's currentNode #jsbench #jsperf (https://jsbench.github.io/#26a49a6033a8a5de00d00e05bf2cb275) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Creating an TreeWalker, DOM element, and setting a walker's currentNode #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 / BUILD.sh
Created May 6, 2019
Demonstrating cross chunk code motion
View BUILD.sh
OPTS=(
"--language_in=ES6_STRICT"
"--language_out=ES5"
"--compilation_level=ADVANCED_OPTIMIZATIONS"
"--formatting=pretty_print"
"--js base.js"
"--chunk base:auto"
"--js intermediate.js"
@jridgewell
jridgewell / index.html
Last active Mar 12, 2019
Weakmap vs Object vs Private State (https://jsbench.github.io/#4faa08f91d4bc895c1f01c8768ae48d2) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Weakmap vs Object vs Private State</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>Array.map vs for-loop push</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>for-of loop vs forEach</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 Mar 4, 2019
Reversing an array #jsbench #jsperf (https://jsbench.github.io/#4e23fe99d44b2c8daf33550c25454bb6) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Reversing an array #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>String startsWith another string #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>
You can’t perform that action at this time.