Wednesday, 11 December 2019

Backend to Frontend lag

So, the title is cryptic but here is what I mean. I am requesting some data from the backend (Node+Mongo):async findStuff() { let startTime = new Date().getTime(); console.log("started"); let stuff = await Stuff.find(...); console.log( "done in " + (new Date().getTime() - startTime) + " milliseconds" ); return stuff; } At the very moment I am averaging ~90ms however the network tab of my browser says ~250ms. Where does exactly this difference come from? In my case the node app is running locally and the db is on mlab.Is it something like 80ms to send the request (browser -> backend) + 90ms to process it + 80ms will pass before it actually hits the browser back?

Submitted December 11, 2019 at 05:12PM by pink_tshirt

No comments:

Post a Comment