Skip to content

Commit

Permalink
scalars: commit chart changes in batch (#4053)
Browse files Browse the repository at this point in the history
Summary:
In #3524, we defined a batch API for chart updates to avoid useless
paints that would be immediately overwritten. We now take further
advantage of this API to only paint charts once all data has been
loaded.

Test Plan:
On the hparams demo directory, this brings paint time (post-network)
for four charts rendering 50 trials each down from about 8 seconds to
under 1 second.

wchargin-branch: scalars-batch-commit
  • Loading branch information
wchargin authored Aug 20, 2020
1 parent bb2d704 commit 19ce4f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class _TfLineChartDataLoader<ScalarMetadata>
_maybeRenderedInBadState: boolean = false;

onLoadFinish() {
this.commitChanges();
if (this.dataToLoad.length > 0 && this._resetDomainOnNextLoad) {
// (Don't unset _resetDomainOnNextLoad when we didn't
// load any runs: this has the effect that if all our
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ export class TfScalarCard extends PolymerElement {
const name = this._getSeriesNameFromDatum(item);
scalarChart.setSeriesMetadata(name, item);
scalarChart.setSeriesData(name, formattedData);
scalarChart.commitChanges();
};

@property({type: Object})
Expand Down

0 comments on commit 19ce4f1

Please sign in to comment.