News for hackers. Stuff that matters.
Re:A SQLite Tutorial with Node.js by davide_ross on Thursday May 17, 2018 @11:53AM (#17092414)
Why use bluebird promises instead of native ones? Are them faster or is it just old habits?
Re:A SQLite Tutorial with Node.js by koolba on Thursday May 17, 2018 @12:45PM (#17092974)
Bluebird's promise implementation is faster in the common case (single thenable chain) and also includes some non-standard convenience functions for composing groups of Promises.

The performance differences are meaningless for most people but if you're used to coding with the convenience functions it's annoying to not have them available.

Re:A SQLite Tutorial with Node.js by invalid_ on Thursday May 17, 2018 @02:55PM (#17094336)
I couldn't find a single use that had bluebird only functionality.
Re:A SQLite Tutorial with Node.js by ScottWRobinson on Thursday May 17, 2018 @12:00PM (#17092484)
Not the author, but it seems as though Bluebird is indeed faster and more efficient (see [1]). Could also just be habit though.

[1]: https://softwareengineering.stackexchange.com/q/278778/30600...

Re:A SQLite Tutorial with Node.js by hinkley on Thursday May 17, 2018 @12:50PM (#17093015)
I'd like to see new benchmarks for that.

If you recall from the V8 6.6 release notes, they talked about performance impromevents in promise and async benchmarks.

The Notes: (see Asynchronous performance improvements) https://v8project.blogspot.com/2018/03/v8-release-66.html

The Graph: https://2.bp.blogspot.com/-T_HWK2MlCOY/WrkGw1-ABJI/AAAAAAAAB...

Looks like about 20%, 30% for some benchmarks.

Note to release note authors: Please put IDs on your headers so people can cite you properly. Thank you.

Re:A SQLite Tutorial with Node.js by hinkley on Thursday May 17, 2018 @02:02PM (#17093746)
Node 10.1, doxbee benchmark:

    file                                       time(ms)  memory(MB)
    promises-bluebird-generator.js                  282       39.13
    promises-native-async-await.js                  292       48.66
    promises-bluebird.js                            305       47.38
    promises-then-promise.js                        382       67.37
    promises-ecmascript6-native.js                  390       66.93
Parallel:

    file                                       time(ms)  memory(MB)
    promises-bluebird.js                           547       99.01
    promises-bluebird-generator.js                 574       98.68
    promises-native-async-await.js                1165      254.62
    promises-ecmascript6-native.js                1231      256.41
    promises-then-promise.js                      1569      302.88
Still a big gap for parallel, but not what it used to be.
Re:A SQLite Tutorial with Node.js by realPubkey on Thursday May 17, 2018 @01:29PM (#17093391)
Looks like native promise is faster at least in the latest chrome. https://jsperf.com/promise-vs-bluebird
Re:A SQLite Tutorial with Node.js by hinkley on Thursday May 17, 2018 @02:35PM (#17094089)
And the speed difference on Firefox 60 is barely outside the confidence interval.

One thing I noted in looking at the bluebird benchmark is that native promises on Node 10 are only a hair slower than bluebird on Node 8.9. So there's a sales pitch for upgrading to node 10 so you can stop using bluebird.

Re:A SQLite Tutorial with Node.js by sciguymcq on Thursday May 17, 2018 @01:07PM (#17093164)
it was just an old habit (author)