Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

152
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda