Skip to content

Commit

Permalink
Remove O(numMetrics * numRuns) metric range computation from generati…
Browse files Browse the repository at this point in the history
…on of each table row (mlflow#662)
  • Loading branch information
smurching committed Oct 29, 2018
1 parent 4edde91 commit 5bed79c
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { Table } from 'react-bootstrap';
import ExperimentViewUtil from './ExperimentViewUtil';
Expand Down Expand Up @@ -35,6 +36,7 @@ class ExperimentRunsTableMultiColumnView extends Component {
sortState: PropTypes.object.isRequired,
runsSelected: PropTypes.object.isRequired,
runsExpanded: PropTypes.object.isRequired,
metricRanges: PropTypes.object.isRequired,
};

getRow({ idx, isParent, hasExpander, expanderOpen, childrenIds }) {
Expand All @@ -49,8 +51,8 @@ class ExperimentRunsTableMultiColumnView extends Component {
runsSelected,
tagsList,
onExpand,
metricRanges,
} = this.props;
const metricRanges = ExperimentViewUtil.computeMetricRanges(metricsList);
const runInfo = runInfos[idx];
const paramsMap = ExperimentViewUtil.toParamsMap(paramsList[idx]);
const metricsMap = ExperimentViewUtil.toMetricsMap(metricsList[idx]);
Expand Down Expand Up @@ -233,4 +235,9 @@ const styles = {
},
};

export default ExperimentRunsTableMultiColumnView;
const mapStateToProps = (state, ownProps) => {
const { metricsList } = ownProps;
return {metricRanges: ExperimentViewUtil.computeMetricRanges(metricsList)};
};

export default connect(mapStateToProps)(ExperimentRunsTableMultiColumnView);

0 comments on commit 5bed79c

Please sign in to comment.