Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

150
Vistas
Bluebird promisifyAll versus promisifying each method

I am using a node module & instead of using PromisifyAll() I am creating a new promise object each time when I am invoking a method of that module.

This is a safe way to promisify?

If not then my entire code structure will change. So is it very critical to change or as long as I am using Promise its fine.

Also is there an impact on Memory or CPU if I promisify each method individually?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I think I'm in a unique position to answer this as both Bluebird and NodeJS core.

It is a safe but relatively slow method of doing promisify (using new Promise), if you are not creating multiple requests per promise then you should be fine with it. If your number of promises scales with your number of requests then it starts to matter.

You can see benchmarks from last week (with new Promise) here: https://kyrylkov.com/2017/04/25/native-promises-async-functions-nodejs-8-performance/

Bluebird does a lot of clever things in promisify and promisifyAll that make it fast.

Note, I've proposed util.promisify for Node and we're working on adding it to the core.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda