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

Fix slow performance of PropTypes.oneOfType() on misses #7510

Merged
merged 1 commit into from
Aug 17, 2016
Merged

Fix slow performance of PropTypes.oneOfType() on misses #7510

merged 1 commit into from
Aug 17, 2016

Commits on Aug 16, 2016

  1. Fix slow performance of PropTypes.oneOfType() on misses

    It used to be slow whenever a type miss occurred because expensive `Error` objects were being created. For example, with `oneOfType([number, data])`, passing a date would create an `Error` object in `number` typechecker for every item.
    
    The savings depend on how much commonly you used `oneOfType()`, and how often it had “misses”. If you used it heavily, you might see 1.5x to 2x performance improvements in `__DEV__` after this fix.
    gaearon committed Aug 16, 2016
    Configuration menu
    Copy the full SHA
    e1f0d88 View commit details
    Browse the repository at this point in the history