Skip to content

Something wrong with the implementation of the "promise.then" #3414

Description

@Daeren

Win 7 x64 | Node.js v4.2.1

Code:

var t = 1000 * 1000 * 1;

function fCookie(x, z) {
    return new Promise(resolve => resolve(x + z));
}

console.time("#1 | Promise");
while(t--) fCookie(1, 3).then(function(r) {});
console.timeEnd("#1 | Promise");

Results:

//-] Without: ".then"
//>  1m - 400ms - 20Mb RAM (nodejs Promise)
//>  1m - 300ms - 15Mb RAM (bluebird Promise)

//-] With: ".then"
//>  1m - 4899ms - 1.1Gb RAM (nodejs Promise) ~ (4x | 3x)
//>  1m - 1255ms - 370Mb RAM (bluebird Promise)

So a lot of memory, so slow ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    memoryIssues and PRs related to Node.js memory management or memory footprint.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions