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

Add a type-checking fast path for primitive types #755

Merged
merged 1 commit into from
Mar 17, 2021
Merged

Add a type-checking fast path for primitive types #755

merged 1 commit into from
Mar 17, 2021

Commits on Feb 19, 2021

  1. Add a type-checking fast path for primitive types

    When `Draft<T>` is applied to a large enum type, TypeScript has to do a
    lot of unnecessary structural comparisons to confirm that no element of
    the enum matches `Function`, `Date`, `RegExp`, etc.  Determining that
    they do match `string` or `number`, on the other hand, is trivial.  This
    change splits `PrimitiveType` out of `AtomicObject` so that the fast
    path can be checked first.
    
    In microsoft/TypeScript#42824, this cut the
    check time from ~2.5 seconds to ~0.3 seconds.
    amcasey committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    a06c6c4 View commit details
    Browse the repository at this point in the history