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

Extremely low performance on node.js 11 #32

Open
peoro opened this issue Feb 16, 2019 · 3 comments
Open

Extremely low performance on node.js 11 #32

peoro opened this issue Feb 16, 2019 · 3 comments
Labels

Comments

@peoro
Copy link

peoro commented Feb 16, 2019

Leakage is incredibly slow on my system (with an Intel(R) Core(TM) i7-3610QM CPU).

Take the following minimal example:

$ cat leakage.js
const sinon = require('sinon');
const leakage = require('leakage');

it(`test`, function(){
        this.timeout( 1000000 );
        leakage.iterate( ()=>{} );
});

$ npx mocha leakage.js
(node:7249) ExperimentalWarning: queueMicrotask() is experimental.
  ✓ test (26544ms)

  1 passing (27s)

The test time decreases from 26s to ~4.6s if I avoid including sinon. In my real tests, where I require a bunch of other modules besides sinon, testing a no-op function for leaks takes minutes.

Is this the expected behavior?
I don't think so, unless it's due to recent fixes for the latest v8, since several issues mention a suggested timeout of 5000ms.

I'm running node v11.10.0 and mocha 5.2.0 on a Linux 4.20.7 system.

@andywer
Copy link
Owner

andywer commented Feb 20, 2019

Hey @peoro!

Sorry for the late response. I have been trying to have a quick look into this issue for todays, but I was just too busy.

Do you use nvm? Can you try if the issue is reproducible on node 10 or node 8?

@andywer andywer added the bug label Feb 20, 2019
@peoro
Copy link
Author

peoro commented Feb 20, 2019

I just setup https://github.com/peoro/leakage-test and am using Travis CI to run the minimal test on a bunch of versions of node (8, 10 and 11).
You can see the results here: https://travis-ci.com/peoro/leakage-test

With node 8 and 10 the minimal test case is fast-ish: less than 10s regardless of whether I require sinon.
With node 11 the results are similar to my local system: as fast as the other cases without sinon, while ~30s after sinon is loaded.

@andywer andywer changed the title Extremely low performance Extremely low performance on node 11 Feb 20, 2019
@andywer andywer changed the title Extremely low performance on node 11 Extremely low performance on node.js 11 Feb 20, 2019
@brandonros
Copy link
Contributor

@peoro is this the case with v12 as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants