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

fix tree api being called twice on initial load due to uninitialized context being used #1229

Merged
merged 1 commit into from
Feb 16, 2022

Conversation

imatiach-msft
Copy link
Contributor

@imatiach-msft imatiach-msft commented Feb 15, 2022

Description

During profiling, I found that /tree was still being called twice on initial load of error analysis component, hurting performance - specifically for large data. This was due to context being used incorrectly in the constructor. For more information, please see:
facebook/react#6598
This is the correct way to use context in constructor. Due to uninitialized context being used in constructor, we were calling the tree API again in componentDidUpdate because the code thought there was a state change.

Areas changed

npm packages changed:

  • responsibleai/causality
  • responsibleai/core-ui
  • responsibleai/counterfactuals
  • responsibleai/dataset-explorer
  • responsibleai/fairness
  • responsibleai/interpret
  • responsibleai/localization
  • responsibleai/mlchartlib
  • responsibleai/model-assessment

Python packages changed:

  • raiwidgets
  • responsibleai
  • erroranalysis
  • rai_core_flask

Tests

  • No new tests required.
  • New tests for the added feature are part of this PR.
  • I validated the changes manually.

Screenshots (if appropriate):

Documentation:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2022

Codecov Report

Merging #1229 (7976ea1) into main (810b861) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1229   +/-   ##
=======================================
  Coverage   67.19%   67.19%           
=======================================
  Files          91       91           
  Lines        4393     4393           
=======================================
  Hits         2952     2952           
  Misses       1441     1441           
Flag Coverage Δ
unittests 67.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


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 810b861...7976ea1. Read the comment docs.

1 similar comment
@imatiach-msft imatiach-msft merged commit 28201b8 into main Feb 16, 2022
@imatiach-msft imatiach-msft deleted the ilmat/fix-context branch February 16, 2022 03:25
gaugup pushed a commit that referenced this pull request Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants