Skip to content

Instantly share code, notes, and snippets.

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

What would you like to do?
IDB list perfs
<!DOCTYPE html>
<script src="//"
(see console)
<button id="run">Run</button>
<script type="text/javascript">
const db = new Kinto({remote: "", bucket: "main"});
const collection = db.collection("tippytop");
const btn = document.getElementById("run");
btn.onclick = async function () {
btn.disabled = true;
await collection.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: ""}});
console.timeEnd("filter by attribute");
btn.disabled = false;
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.