IsakOriginal post
Rank 2: Process
This code is taking 400+ms to run, why so long?
TypeScript
console.time()
const { account } = createSessionClient(event);let appwriteUser: any;try { appwriteUser = await account.get();} catch (error) { throw redirect(303, "/login");}
let domainId = Number(appwriteUser.prefs?.domain) || 0;
console.timeEnd()Summary
Code is taking over 400ms to run due to the API request. Optimize the code to reduce the time by using asynchronous operations to enhance performance.