18 ms·
Depends what you are waiting for. Maybe an in memory cache hit---that you explicitly code---causes a sync resolve to happen, woohoo! But if it goes to IO and
by dogboat 2y ago
Depends what you are waiting for.
Maybe an in memory cache hit---that you explicitly code---causes a sync resolve to happen, woohoo!
But if it goes to IO and you are waiting for the event loop to schedule you back in you could be in for a shock even if the IO op is tiny. Especially doing it alot.
Only matters probably on a high CPU usage server which hopefully you avoid by scaling up on cpu and using all the cores.
On the other hand... you are being cooperative :)
But tight loop IO is an antipattern ... as is doing a lot---millions---of IO ops from node (per request or job) that you need to worry about this (use a different language for your DB server!).