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

[expect] optimize compare nodes #8368

Merged
merged 3 commits into from Apr 27, 2019

Conversation

Projects
None yet
5 participants
@Connormiha
Copy link
Contributor

commented Apr 23, 2019

Summary

Removed needless checking for isEqualNode because it checked before.
Used lazy checking for second object.

Test plan

@scotthovestadt

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

Thanks for this! Obviously the check is completely unnecessary in some cases. Questions:

  1. Where did typeof a.isEqualNode === 'function' go? It looks necessary at a quick glance.
  2. Any idea how expensive isDomNode is in terms of ops/sec? Just curious.
@Connormiha

This comment has been minimized.

Copy link
Contributor Author

commented Apr 23, 2019

Where did typeof a.isEqualNode === 'function' go? It looks necessary at a quick glance.

This has already been checked inside isDomNode

Any idea how expensive isDomNode is in terms of ops/sec? Just curious.

Very cheap, but expect can be inside for loop is some test cases.

@scotthovestadt

@SimenB SimenB requested a review from pedrottimark Apr 24, 2019

@pedrottimark

This comment has been minimized.

Copy link
Collaborator

commented Apr 24, 2019

Thank you for improving the calling code after my too-hurried change to isDomNode in #8064

@pedrottimark

This comment has been minimized.

Copy link
Collaborator

commented Apr 26, 2019

@Connormiha Forgot to notice no line under Chore & Maintenance in CHANGELOG.md

Can you please merge changes from jest/master to avoid conflict, and then add the line, so I can merge your contribution.

@Connormiha Connormiha force-pushed the Connormiha:optimize-check-dom-node branch from 5c5de91 to 9533e4c Apr 26, 2019

@Connormiha

This comment has been minimized.

Copy link
Contributor Author

commented Apr 26, 2019

I did rebase from master @pedrottimark

@codecov-io

This comment has been minimized.

Copy link

commented Apr 26, 2019

Codecov Report

Merging #8368 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8368      +/-   ##
==========================================
- Coverage   62.35%   62.34%   -0.01%     
==========================================
  Files         266      266              
  Lines       10740    10738       -2     
  Branches     2611     2611              
==========================================
- Hits         6697     6695       -2     
  Misses       3460     3460              
  Partials      583      583
Impacted Files Coverage Δ
packages/expect/src/jasmineUtils.ts 91.07% <0%> (-0.16%) ⬇️

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 8b6464d...9533e4c. Read the comment docs.

@pedrottimark pedrottimark merged commit 4c3c712 into facebook:master Apr 27, 2019

4 of 11 checks passed

ci/circleci: test-jest-circus CircleCI is running your tests
Details
ci/circleci: test-node-10 CircleCI is running your tests
Details
ci/circleci: test-node-6 CircleCI is running your tests
Details
ci/circleci: test-node-8 CircleCI is running your tests
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
deploy/netlify Deploy preview processing.
Details
facebook.jest in progress
Details
ci/circleci: lint-and-typecheck Your tests passed on CircleCI!
Details
ci/circleci: test-browser Your tests passed on CircleCI!
Details
ci/circleci: test-node-11 Your tests passed on CircleCI!
Details
ci/circleci: test-or-deploy-website Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.