Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Perf optimizations #93

Merged
merged 18 commits into from
Feb 25, 2016
Merged

Perf optimizations #93

merged 18 commits into from
Feb 25, 2016

Conversation

divmain
Copy link
Contributor

@divmain divmain commented Feb 18, 2016

This PR includes some performance improvements. We will also be dropping Radium from Victory, and providing docs for how to use the two together. But that change will occur in a separate PR.

Here's what performance looks like after the changes (including removal of Radium). This is a ~3-4x improvement over the original performance.

relative-performance

/cc @boygirl @coopy

@@ -73,8 +73,8 @@ module.exports = {
return this.getDomainFromCategories(props, axis);
}
// find the global min and max
const rawDatasets = (props.stacked || this.shouldGroup(props)) ? props.data : [props.data];
const datasets = Data.formatDatasets(rawDatasets, props)
const hasMultipleDatasets = props.stacked || this.shouldGroup(pro
Copy link
Contributor

Choose a reason for hiding this comment

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

Line cut off?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Weird...

@coopy
Copy link
Contributor

coopy commented Feb 23, 2016

This might work for statically styled components (I'll let @boygirl comment on the new API); we still need to address perf in cases where styles are dynamic.

@divmain divmain force-pushed the perf-optimizations branch 3 times, most recently from c10f113 to 1453c11 Compare February 24, 2016 23:39
@@ -251,6 +252,12 @@ export default class VictoryBar extends React.Component {

static getDomain = BarHelpers.getDomain.bind(BarHelpers);

componentWillMount() {
this.memoized = {
getStyles: memoizerific(1)(Helpers.getStyles)
Copy link
Member

Choose a reason for hiding this comment

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

Can we get a code comment as to what memoizerific(1) is doing?

@divmain
Copy link
Contributor Author

divmain commented Feb 25, 2016

Hmm... tests are passing locally but not in CI. I'm investigating.

import { VictoryLabel } from "victory-label";
import { Helpers } from "victory-util";
import { VictoryLabel } from "victory-core";
import { Helpers } from "victory-core";
Copy link
Contributor

Choose a reason for hiding this comment

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

import { Helpers, VictoryLabel } from "victory-core";

import { PropTypes as CustomPropTypes, Helpers } from "victory-util";
import { VictoryAnimation } from "victory-animation";
import { PropTypes as CustomPropTypes, Helpers } from "victory-core";
import { VictoryAnimation } from "victory-core";
Copy link
Contributor

Choose a reason for hiding this comment

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

^

@coopy
Copy link
Contributor

coopy commented Feb 25, 2016

Looks good - just some style / trivial comments. PERF++!

@boygirl
Copy link
Contributor

boygirl commented Feb 25, 2016

@divmain I think there are still a few references to victory-label in the demos

@boygirl
Copy link
Contributor

boygirl commented Feb 25, 2016

hmm, actually all of the demos are broken except for the axis demo. Now I'm sad that CI is passing :( Are you able to reproduce this problem @divmain

@divmain
Copy link
Contributor Author

divmain commented Feb 25, 2016

@boygirl I didn't think to check the demos. Figured builder run check was adequate. I'll do that now!
Edit: Not sure what's wrong. I'm going to pick this back up tomorrow.

@divmain
Copy link
Contributor Author

divmain commented Feb 25, 2016

Alright, this should be good to go. Still passing builder run check locally, and the demo is working as expected. Ping for final review @boygirl and @coopy.

@boygirl
Copy link
Contributor

boygirl commented Feb 25, 2016

cc/ @divmain some of the demos are still importing VictoryLabel from victory-label. It's probably still hanging around in your node_modules. Please change these to depend on victory-core. Offenders are demos/victory-axis-demo, demos/victory-line-demo, demos/victory-scatter-demo and docs/victory-bar/docs.jsx. I think that's it. Approved once these are resolved.

@divmain
Copy link
Contributor Author

divmain commented Feb 25, 2016

Meh. Sorry about that.

@divmain
Copy link
Contributor Author

divmain commented Feb 25, 2016

@boygirl is there a way to check health of demos from CI? That would be a helpful change.

@boygirl
Copy link
Contributor

boygirl commented Feb 25, 2016

Currently no. Since they are all their own components though, we could at least be trying to render them in tests. What I would ideally like would be screenshot comparison, but there still isn't a super good solution for that as far as I can tell. I'll open an issue for the easy win though.

@boygirl
Copy link
Contributor

boygirl commented Feb 25, 2016

@divmain
Copy link
Contributor Author

divmain commented Feb 25, 2016

thxmuch :)

divmain added a commit that referenced this pull request Feb 25, 2016
@divmain divmain merged commit 256a305 into master Feb 25, 2016
@divmain divmain deleted the perf-optimizations branch February 25, 2016 23:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants