Skip to content

Reduce rerendering of DagRunBar#22161

Merged
bbovenzi merged 1 commit intomainfrom
memoize-dag-run-bar
Mar 10, 2022
Merged

Reduce rerendering of DagRunBar#22161
bbovenzi merged 1 commit intomainfrom
memoize-dag-run-bar

Conversation

@bbovenzi
Copy link
Contributor

Use React.memo and a custom equality function to eliminate unnecessary rerenders of the DagRunBar component

DagRunBar is the individual bar of the duration chart at the top of the Grid view (my local scheduler is broken):
Screen Shot 2022-03-10 at 2 03 36 PM

Below is a debug console.log while autorefreshing a run of example_task_group.
5 turns to 8 initial renders is because there were more runs.
Subsequent renders are from the active dag run bar updating with new data.

Before After
Screen Shot 2022-03-10 at 1 32 43 PM Screen Shot 2022-03-10 at 1 50 32 PM

^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

Memoize component with a custom compare function to reduce rerenders
@boring-cyborg boring-cyborg bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Mar 10, 2022
@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Mar 10, 2022
@github-actions
Copy link

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@bbovenzi bbovenzi merged commit 805cde3 into main Mar 10, 2022
@bbovenzi bbovenzi deleted the memoize-dag-run-bar branch March 10, 2022 19:34
@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) okay to merge It's ok to merge this PR as it does not require more tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants