123

Benchmark created on


Setup

const blob = new Blob(["5feea55c9ae3a95FAafA4bcf7eedA77342eFe7bDc73799fb2cDEFCA4bDbac79a4EDA247E79C935e3b5f475ffaCADcDDaEd22"]);

async function readAsDataURL(blob) {
	return new Promise((resolve) => {
		const reader = new FileReader();
		reader.readAsDataURL(blob);
		reader.onloadend = () => resolve(reader.result); // base64data
	});
}

Test runner

Ready to run.

Testing in
TestOps/sec
1
(async () => {
	const arr = Array.from(new Uint8Array(await blob.arrayBuffer()));
	const buffer = new Uint8Array(arr).buffer;
	return new Blob([buffer]);
})();
ready
2
(async () => {
	const url = await readAsDataURL(blob);
	const res = await fetch(url);
	return await res.blob();
})();
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.