grunge-stack
grunge-stack copied to clipboard
notes example app is slow
Have you experienced this bug with the latest version of the template?
yes
Steps to Reproduce
(1) Run npx create-remix@latest --template remix-run/grunge-stack
today
(2) npm run dev
(which runs remix dev --manual -c "arc sandbox -e testing"
)
(3) Sign up with an email and password from the home page.
(4) view and add notes using the notes app
(5) observe the speed of page loads for the notes app and generally
Expected Behavior
All routes should be "fast" especially since it is using a local sandbox and is a demo app to get people started.
Actual Behavior
The notes routes and the sign up route feel sluggish, here's my network tab:
I added some console timings around some things, one thing I'm seeing is in app/models/note.server.ts
export async function getNoteListItems({
userId,
}: Pick<Note, "userId">): Promise<Array<Pick<Note, "id" | "title">>> {
console.time("all");
console.time("arc.tables");
const db = await arc.tables();
console.timeEnd("arc.tables");
console.time("db.note.query");
const result = await db.note.query({
KeyConditionExpression: "pk = :pk",
ExpressionAttributeValues: { ":pk": userId },
});
console.timeEnd("db.note.query");
console.timeEnd("all");
return result.Items.map((n: any) => ({
title: n.title,
id: skToId(n.sk),
}));
}
arc.tables
timing is about 1.3s
db.note.query
timing is about 0.9s
all
timing is about 2.23s
Curious if anyone else can replicate it. I guess I can't rule out something weird with my network. I do have a vpn for work but I tried with it turned off as well.