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

Memory leak fix: release source map info after processed and minor optimizations #8234

Merged
merged 6 commits into from
Mar 29, 2019

Conversation

scotthovestadt
Copy link
Contributor

Summary

Previously, sourceMaps:

  • Was always populated with a call to getSourceMapInfo and set to an object, even when it was guaranteed to be empty.
  • Was never released from memory.

It's companion, coverage, was released from memory but unfortunately using the delete operator, which is significantly slower than = undefined even with modern V8 versions:
https://jsperf.com/delete-vs-undefined-vs-null/87

I've resolved the leak and minor performance issues along with a minor change to formatTestResults that is slightly more efficient for the same result.

Test plan

  • All tests pass.
  • Memory and performance characteristics verified.

@codecov-io
Copy link

codecov-io commented Mar 29, 2019

Codecov Report

Merging #8234 into master will decrease coverage by 0.03%.
The diff coverage is 31.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8234      +/-   ##
==========================================
- Coverage   62.33%   62.29%   -0.04%     
==========================================
  Files         265      265              
  Lines       10553    10554       +1     
  Branches     2565     2569       +4     
==========================================
- Hits         6578     6575       -3     
- Misses       3387     3391       +4     
  Partials      588      588
Impacted Files Coverage Δ
packages/jest-runner/src/runTest.ts 2.43% <0%> (-0.1%) ⬇️
packages/jest-reporters/src/coverage_reporter.ts 59.54% <0%> (-0.46%) ⬇️
packages/jest-core/src/ReporterDispatcher.ts 83.33% <100%> (+2.08%) ⬆️
packages/jest-test-result/src/formatTestResults.ts 55.55% <50%> (-9.67%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e08be02...69244bf. Read the comment docs.

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants