jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
Understand what merging two objects together looks like for timing
function generateRandomString(length) {
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let result = '';
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * characters.length));
}
return result;
}
function getRandomCoordinate() {
return {
x: Math.random() * 400,
y: Math.random() * 400,
z: Math.random() * 400,
};
}
function getRandomOrientation() {
return {
roll: Math.random() * 360,
pitch: Math.random() * 360,
yaw: Math.random() * 360,
};
}
const SPATIAL_SO_DATA = new Array(100_000).fill("0").map(() => ({
parent: generateRandomString(32),
transform: {
point: getRandomCoordinate(),
orientation: getRandomOrientation(),
}
}));
const CORE_SO_DATA = Array(100_000).fill("0").map(() => ({
/** Globally unique ID of the scene object. */
id: generateRandomString(32),
/** Specifies what we'll render in the scene for this scene object. */
renderData: {
type: "rg",
uri: "rg/something/something",
scalingFactor: 0.1,
format: "STL",
},
color: generateRandomString(6),
/** Optional boolean that specifies whether the scene object is selectable. Defaults to true. */
isSelectable: true,
}));Ready to run.
| Test | Ops/sec | |
|---|---|---|
| How fast | | ready |
| Ignored | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.