Public
Edited
Mar 28
Insert cell
result = table(stats, numWarmups, numTrials, numRepeats)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
X = math.random([N, N], -10, 10)
Insert cell
fn = math.abs
Insert cell
// experiments are an array of objects with a name and a function to run.
experiments = [
{ name: "mathV8.1.1.map", run: () => math8.map(X, fn) },
{ name: "mathV9.5.2.map", run: () => math9.map(X, fn) },
{ name: "mathV10.6.4.map", run: () => math10.map(X, fn) },
{ name: "mathV11.8.0.map", run: () => math11_8_0.map(X, fn) },
{ name: "mathV11.8.1.map", run: () => math11_8_1.map(X, fn) },
{ name: "mathV11.12.0.map", run: () => math11.map(X, fn) },
{ name: "mathV12.4.3.map", run: () => math12.map(X, fn) },
{ name: "mathV13.2.3.map", run: () => math13.map(X, fn) },
{ name: "mathV14.3.1.map", run: () => math14_3_1.map(X, fn) },
{ name: "mathV14.4.0.map", run: () => math14_4_0.map(X, fn) },
]
Insert cell
function createTraverse(array, callback, skipIndex = false, returnValue = false) {
const index = skipIndex ? undefined : []

function updateIndex(depth, i) {
index[depth] = i;
}
function recurse(value, depth) {
if (Array.isArray(value)) {
value.map((child, i) => {
return recurse(child, depth + 1);
});
} else {
callback(value);
}
}
}
Insert cell
math = import("https://cdn.jsdelivr.net/npm/mathjs@14/+esm")
Insert cell
stats = computeStats(reRun, experiments, numTrials, numWarmups, numRepeats)
Insert cell
import {table, commas, computeStats} from "@domoritz/benchmark-utils"
Insert cell
math14_4_0 = import("https://cdn.jsdelivr.net/npm/mathjs@14.4.0/+esm")
Insert cell
math14_3_1 = import("https://cdn.jsdelivr.net/npm/mathjs@14.3.1/+esm")
Insert cell
math10 = import("https://cdn.jsdelivr.net/npm/mathjs@10/+esm")
Insert cell
math9 = import("https://cdn.jsdelivr.net/npm/mathjs@9/+esm")
Insert cell
math8 = import("https://cdn.jsdelivr.net/npm/mathjs@8/+esm")
Insert cell
math11 = import("https://cdn.jsdelivr.net/npm/mathjs@11/+esm")
Insert cell
math11_8_0 = import("https://cdn.jsdelivr.net/npm/mathjs@11.8.0/+esm")
Insert cell
math11_8_1 = import("https://cdn.jsdelivr.net/npm/mathjs@11.8.1/+esm")
Insert cell
math12 = import("https://cdn.jsdelivr.net/npm/mathjs@12/+esm")
Insert cell
math13 = import("https://cdn.jsdelivr.net/npm/mathjs@13/+esm")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more