question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Investigate speed regressions

See original GitHub issue

šŸ’„ Regression Report

Speed regression in Jest@23.x

Last working version

Worked up to version:

Jest@22.x

Stopped working in version:

A big chunk of the regression was introduced with this PR https://github.com/facebook/jest/pull/5932

To Reproduce

Steps to reproduce the behavior:

Iā€™ve been using a small repo, https://github.com/rogeliog/jest-benchmark(I can give you access if you need to) to run simple benchmarks across Jest versions.

Expected behavior

Test should run faster

Here are is progress that Iā€™ve made on the speed regression investigation.

  1. A big chunk of the speed regression was introduced here https://github.com/facebook/jest/pull/5932
  2. Iā€™ve been testing with https://github.com/rogeliog/jest-benchmark and the differences that I get between jest@22 and jest@23 are the following
    ------------------- Jest@22 -------------------------
    0m2.338s
    0m2.317s
    ------------------- Jest@23 -------------------------
    0m6.068s
    0m6.048s
    

Initial findings

  1. In jest@22 https://github.com/facebook/jest/blob/v22.4.4/packages/jest-config/src/normalize.js#L128 returns null which causes https://github.com/facebook/jest/blob/v22.4.4/packages/jest-config/src/normalize.js#L130-L132 not to get executed.

  2. In jest@23 https://github.com/facebook/jest/blob/master/packages/jest-config/src/normalize.js#L143 returns a path and https://github.com/facebook/jest/blob/master/packages/jest-config/src/normalize.js#L144-L146 gets executed.

  3. If I comment out https://github.com/facebook/jest/blob/master/packages/jest-config/src/normalize.js#L144-L146 then I get the following stats.

    ------------------- Jest@22 -------------------------
    0m2.537s
    0m2.331s
    ------------------- Jest@dev -------------------------
    0m3.658s
    0m3.633s
    
  4. Iā€™m not to familiar the reasoning behind it, but it seems that since the original there were some comments about them returning different values https://github.com/facebook/jest/pull/5932#discussion_r179545920.

cc: @cpojer, @arcanis

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
jkilliancommented, Nov 28, 2018

For what itā€™s worth, turns out I misdiagnosed the cause of the problem. It was actually an upgrade from ts-jest 23.1.4 -> 23.10.5 which was causing the large slowdown and memory usage increase (babel and jest proper were red herrings). We found switching our jest config from:

    globals: {
      'ts-jest': {
        diagnostics: false,
      },
    },

to

    globals: {
      'ts-jest': {
        diagnostics: false,
        isolatedModules: true,
      },
    },

resolved the performance issues for us! Just posting the info here to absolve jest of the blame I put on it šŸ˜ and to help anyone else if they have similar issues with ts-jest

2reactions
nasreddineskandranicommented, Dec 16, 2018

please check my comment here: problem: https://github.com/facebook/jest/issues/6783#issuecomment-445560998 investigation: https://github.com/facebook/jest/issues/6783#issuecomment-445660665 cause: https://github.com/facebook/jest/issues/6783#issuecomment-446123323 solution: https://github.com/facebook/jest/pull/7518

I am sure 100% that the TestScheduler is creating the regression for the case i reported in the issue. I donā€™t know yet if solving this will help with the run on all files => if you think i should isolate this in a specific issue let me know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Investigating Regression to the Mean in Before-and-After ...
This study shows that an observational before-and-after speed data analysis cannot collect speed measurements without measurement error andĀ ...
Read more >
Investigating Regression to the Mean in ... - SAGE Journals
The paper concludes with suggestions for more rigorous statistical methods, preferably suited for use with disaggregate speed data, that may help to reduce...
Read more >
A typing instructor builds a regression model to investigate ...
Answer to: A typing instructor builds a regression model to investigate what factors determine typing speed for students with two months of...
Read more >
Simple Regression
There are a number of advanced statistical tests that can be used to examine whether or not these assumptions are true for any...
Read more >
Regression Model-Based Walking Speed Estimation Using ...
These regression-based approaches for walking speed estimation are based ... Also, the authors plan to carry out clinical investigations toĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found