D1 adding more latency than expected

Im using sveltekit and i created 2 test routes. they essentially do the same but one does a select 1; in d1.
When warm the the difference in response time is 50ms which just seems super high considering the query takes less than 1ms.
I chose the cloest location to me when i created d1

I use workers with assets. here the code for both api endpoints i used to just test it out
Is this really the expected behaviour?

No Db:
import type { RequestHandler } from './$types';

export const GET: RequestHandler = async () => {
    const uuid = crypto.randomUUID();
    return new Response(uuid);
};

With D1:
import { drizzle } from 'drizzle-orm/d1';
import { sql } from 'drizzle-orm';
import type { RequestHandler } from './$types';

export const GET: RequestHandler = async ({ platform }) => {
    const db = drizzle(platform!.env.DB);
    await db.run(sql`SELECT 1`);
    const uuid = crypto.randomUUID();
    return new Response(uuid);
};


i tried without drizzle as well but i dont see a difference
Was this page helpful?