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

151
Views
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 answers
Answer question

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 Report
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!