@Martin Heidegger yes, you're right about this one.
@radmen Hmm, parallel operations make quite some differences when doing file access, running tcp requests or other db requests. Assuming that serial is fast enough is a treacherous assumption for slower networks/hardware, particularly when your system is a fast one.
@Martin Heidegger you wanted to say that it is serial rather than parallel?
You are completely right.
Tbh, sometimes there's no significant gain from making parallel calls. JS is still single threaded which means that Promises are not taking any benefits from multi-threaded architecture. They just try to optimize CPU usage.
@radmen The Promise version of yours is parallel then serial, your async version does all three things in series.
sure, you can do it this way
oh in case people don't know a lot of the async around scuttlebutt gets handles by
@radmen quickly pointing out a difference and then hiding behind a stone:
const [ resultA, resultB ] = await Promise.all([doSomethingForA(), doSomethingForB()]) const resultC = await doSomethingForC() doSomethingHere(resultA, resultB, resultC)
Show whole feed