Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

propTypes validation on data causes performance issue #4

Open
burgalon opened this issue Feb 3, 2016 · 4 comments
Open

propTypes validation on data causes performance issue #4

burgalon opened this issue Feb 3, 2016 · 4 comments

Comments

@burgalon
Copy link

burgalon commented Feb 3, 2016

Because of the propTypes defined on data, when dealing with multiple graphs of +180 ticks, you start to get a serious lag and browser hanging because of prop types validation

@motiz88
Copy link
Owner

motiz88 commented Feb 3, 2016

Thanks for the report. I'm not willing to give up propTypes validation outright but if you have a suggested fix, I'd love to see a PR. In any case this issue impacts dev workflows only, since propTypes checks are generally not used in production.

@motiz88
Copy link
Owner

motiz88 commented Feb 3, 2016

A good compromise here might be to use a custom validation function in place of (the outermost) React.propTypes.arrayOf, so that we'll always inspect an O(1) sample of the data array, rather than all elements. That way we'll still guard against major errors and ensure that the user at least appears to know what they're doing.

@pgruenbacher
Copy link

I faced a similar performance hit when in developing environment.

@burgalon
Copy link
Author

burgalon commented Jun 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants