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
// 此区域的代码不计入性能测试
let testLastTime;
let testFrame;
let testLastFameTime;
// 模拟一个简单的动画工作负载,使其更接近真实场景
let mockElementX = 0;
const mockAnimationWork = () => {
// 模拟一些简单的计算和DOM操作(如样式更新)
mockElementX = (mockElementX + 1) % 100;
document.body.style.setProperty('--test-pos', `${mockElementX}px`);
};
Ready to run.
| Test | Ops/sec | |
|---|---|---|
| 用例 A: 基准测试 (无FPS计算) | | ready |
| 用例 B: 对比测试 (包含FPS计算) | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.