Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bechmark for promises-native-async-await.js #1661

Open
Mirodil opened this issue Sep 21, 2020 · 0 comments
Open

Fix bechmark for promises-native-async-await.js #1661

Mirodil opened this issue Sep 21, 2020 · 0 comments

Comments

@Mirodil
Copy link

Mirodil commented Sep 21, 2020

(This issue tracker is only for bug reports or feature requests, if this is neither, please choose appropriate channel from http://bluebirdjs.com/docs/support.html)

Please answer the questions the best you can:

  1. What version of bluebird is the issue happening on? master branch @3.7.2

  2. What platform and version? (For example Node.js 0.12 or Google Chrome 32) macOS nodejs 10.22.1

  3. Did this issue happen with earlier version of bluebird? None

I think the comparison in the benchmark is not fair as promises-bluebird.js uses concurrency, but promises-native-async-await.js uses not concurrency. Here is a code example:

// file promises-bluebird.js 
var blobIdP = blob.put(stream);
var fileP = self.byUuidOrPath(idOrPath).get();
var version, fileId, file;

bluebird.join(blobIdP, fileP, function(blobId, fileV) { // <----this is concurrent
    ...
})

vs

var blob = blobManager.create(account);
var tx = db.begin();
var blobId = await blob.put(stream); // <----this is not concurrent
var file = await self.byUuidOrPath(idOrPath).get(); // <----this is not concurrent

At least should be the following to be fair:

var blob = blobManager.create(account);
var tx = db.begin();
var blobId = blob.put(stream);
var file = self.byUuidOrPath(idOrPath).get();
[blobId, file] = await Promise.all([blobId, file]);// <----this is concurrent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant