Just-Moh-it / Pckd

The ⚡️ analytics-intensive, self-hostable link-shortener with a beautiful UI | AKA free bit.ly alternative 🚀
https://docs.pckd.me/
MIT License
783 stars 95 forks source link

Avoid using await before redirecting the target url #6

Closed anishsrinivasan closed 2 years ago

anishsrinivasan commented 2 years ago

Hi Mohit,

I feel we can optimize and increase the speed more by avoiding the promise for updating the hit count, as it can happen asynchronously. It might not even make a big difference in terms of speed for now, but when the data gets too populated, this might be useful.

https://github.com/Just-Moh-it/Pckd/blob/16e2238e42c02a35dff3d3759879e7f943c5c7a1/server/src/routes/all.js#L46-L57

But overall, amazing work. Good day!

Just-Moh-it commented 2 years ago

Thanks for noticing that. Don't know how await got left in there, maybe muscle memory. And tysm for the compliments, motivates me to push harder every time 😊