commons-app / commonsmisc

4 stars 5 forks source link

Use user id instead of username in individual queries #8

Closed maskaravivek closed 5 years ago

maskaravivek commented 5 years ago

As of now all queries take in the username parameter and fetch the userid from the database.

Each call to fetch userId from username takes around 0.13 seconds. All the queries combined call this 5 times. It would save us roughly around 0.5 seconds if we just fetch the userid once.

In nutshell, not a great optimization but every second count, so making this change. :)