Skip to content

Instantly share code, notes, and snippets.

@leplatrem leplatrem/index.html
Last active Oct 17, 2018

Embed
What would you like to do?
IDB list perfs
<!DOCTYPE html>
<html>
<head>
<script src="//unpkg.com/kinto@12.1.1/dist/kinto.noshim.js"
integrity="sha384-HAvdRnGimsCGQDQo6XnILXgZ3rJGI2RGQXdrH0wLZURMuFNyZIvYOOrAwgs2nsgj"
crossorigin="anonymous">
</script>
</head>
<body>
<h1>Benchmark</h1>
(see console)
<button id="run">Run</button>
<script type="text/javascript">
const db = new Kinto({remote: "https://firefox.settings.services.mozilla.com/v1", bucket: "main"});
const collection = db.collection("tippytop");
const btn = document.getElementById("run");
btn.onclick = async function () {
btn.disabled = true;
console.time("sync");
await collection.sync();
console.timeEnd("sync");
console.time("list all");
await collection.list();
console.timeEnd("list all");
console.time("filter by id");
await collection.list({filters: {id: "7210b4bc-81f6-4f04-976e-1acf5faeb740"}});
console.timeEnd("filter by id");
console.time("filter by attribute");
await collection.list({filters: {domain: "amazon.es"}});
console.timeEnd("filter by attribute");
btn.disabled = false;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.