Published
Edited
Mar 13, 2022
4 stars
Insert cell
Insert cell
data = Float64Array.from({ length: 1e6 }, Math.random)
Insert cell
Insert cell
Insert cell
{
const t0 = performance.now();
Uint32Array.from(data, (_, i) => i);
return performance.now() - t0;
}
Insert cell
Insert cell
{
const t0 = performance.now();
const n = data.length;
const B = new Uint32Array(n);
for (let i = 0; i < n; i++) B[i] = i;
return performance.now() - t0;
}
Insert cell
Insert cell
{
const t0 = performance.now();
const n = data.length;
const B = new Uint32Array(n);
const f = (_, i) => i;
for (let i = 0; i < n; i++) B[i] = f(data[i], i);
return performance.now() - t0;
}
Insert cell
Insert cell
{
const t0 = performance.now();
Array.from(data, (_, i) => i);
return performance.now() - t0;
}
Insert cell
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