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
<script src="https://cdnjs.cloudflare.com/ajax/libs/buffer/6.0.3/buffer.min.js" />// Generate a ~1KB JSON string
const largeObject = {
id: "bench-test-999",
timestamp: new Date().toISOString(),
description: "Performance comparison for encoding methods",
// Fill with ~900 bytes of data to reach ~1KB total JSON size
payload: "x".repeat(900),
tags: ["perf", "encoding", "btoa", "buffer", "urlencode"]
};
const jsonString = JSON.stringify(largeObject);
// Pre-encoded versions for the decoding (vice-versa) tests
const b64Data = btoa(jsonString);
const urlData = encodeURIComponent(jsonString);
const bufferData = Buffer.from(jsonString).toString('base64');Ready to run.
| Test | Ops/sec | |
|---|---|---|
| btoa | | ready |
| encodeURIComponent | | ready |
| Buffer.from | | ready |
| atob | | ready |
| decodeURIComponent | | ready |
| Buffer.from | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.