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

Compare perf - pure components, disable ROC curve thumbnail animations #598

Merged
merged 4 commits into from
Jan 4, 2019

Conversation

yebrahim
Copy link
Contributor

@yebrahim yebrahim commented Dec 27, 2018

Fixes #597.

The main problem here was that the PlotCard component was not pure. This was causing all plots to re-render fully whenever state changes on the compare page, which happens on collapsing/expanding sections, and on selecting/deselecting runs.

Simply extending PureComponent doesn't work here, since it gets an array of objects, so shallow comparison always fails. Implementing shouldComponentUpdate to properly check fixes this.

This PR also disables animations in thumbnailed ROC curve, and turns RunList and CompareTable into pure components, which reduces the number of re-renders when collapsing all compare page sections from 280+ to about 50. Some of these are still because of some react-vis axis mutations that I do not understand, but it's quite a bit more usable.

Tip: turn off whitespace when viewing this change.

/area front-end
/assign @rileyjbauer


This change is Reviewable

@yebrahim yebrahim changed the title Use pure components, no animations for roc curve thumbnails Compare perf - pure components, disable ROC curve thumbnail animations Dec 27, 2018
const height = width * 0.65;
const isSmall = width < 600;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be handled by a prop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already pass the maxDimension as a prop, my goal so far was to let viewers decide how they want to render given that one number.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with you leaving it, I just thought it was a bit strange to have behavior controlled by size like that, rather than directly through some flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Viewers are treated differently from other components though, I planned for them to behave more like black boxes. They have enough information about what they can display given a certain size, but their parents don't have that insight.

selectedIds,
workflowObjects,
});
this._loadParameters(selectedIds);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are probably quite a few places we can improve the app in this way. I'll keep out an eye for them in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean consolidating setState calls?
I think the main issue isn't how many times the container component renders though, it's cascading the rendering. Components should be pure wherever they can be, so that a parent re-render does not trigger all of its subtree to re-render as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That, and removing unnecessary setState callbacks that could be achieved using parameters

@rileyjbauer
Copy link
Contributor

/lgtm

@yebrahim
Copy link
Contributor Author

yebrahim commented Jan 4, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yebrahim

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yebrahim

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit d4d4f62 into kubeflow:master Jan 4, 2019
@yebrahim yebrahim deleted the compare-perf branch January 9, 2019 19:02
Linchin pushed a commit to Linchin/pipelines that referenced this pull request Apr 11, 2023
…flow#598)

* Added concatenate license command, fixed token api scanner

* Fixed logic for concatenate_license, proper prints

* Removed license as per @zhenghuiwang
magdalenakuhn17 pushed a commit to magdalenakuhn17/pipelines that referenced this pull request Oct 22, 2023
HumairAK pushed a commit to red-hat-data-services/data-science-pipelines that referenced this pull request Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compare page perf optimizations
3 participants