Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

87
Views
Diferencia de rendimiento entre devolver dos resultados `Promise` de un `Promise.all` frente a `await`-ing en `return` en sí

Considere los siguientes dos enfoques:

 // approach 1 const someFunc = async () => { const [responseA, responseB] = await Promise.all([ someQuery({ param: 'abc' }), someQuery({ param: '123' }), ]) return { responseA, responseB, } }
 // approach 2 const someFunc = async () => { return { responseA: await someQuery({ param: 'abc' }), responseB: await someQuery({ param: '123' }) } }

¿Responderían estos dos enfoques con la misma velocidad? Supongo que el enfoque Promise.all sería un poco más rápido, porque await todas las promesas antes de responder.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!