Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Performance improvement: Fetch graph and plotly in parallel instead of sequentially #725

Merged
merged 3 commits into from
Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Changed
- [#723](https://github.com/plotly/dash-core-components/pull/723) Changed npm package content to allow source code inclusion from other projects
- [#725](https://github.com/plotly/dash-core-components/pull/725) Improve async graph performance by parallelizing resource fetching instead of fetching sequentially

### Updated
- [#706](https://github.com/plotly/dash-core-components/pull/706)
Expand Down
4 changes: 3 additions & 1 deletion src/components/Graph.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ class PlotlyGraph extends Component {
}
}

const RealPlotlyGraph = asyncDecorator(PlotlyGraph, () => plotly().then(graph));
const RealPlotlyGraph = asyncDecorator(PlotlyGraph, () =>
Promise.all([plotly(), graph()]).then(([, graph]) => graph)
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

parallelize requests


const ControlledPlotlyGraph = memo(props => {
const {className, id} = props;
Expand Down