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

Avoid layout calculations in assert_bits to speed up match checking #57546

Closed
wants to merge 1 commit into from

Commits on Jan 12, 2019

  1. Avoid layout calculations in assert_bits to speed up match checking

    assert_bits ensures that the given type matches the type of the constant
    value, and additionally performs a query for the layout of the given
    type to get its size. This is then used to assert that it matches the
    size of the constant. But since the types are already known to be the
    same, this second check is unnecessary, and skipping it also allows to
    skip the expensive layout query.
    
    For the unicode_normalization crate, the match checking time drops from
    about 3.8s to about 0.8s for me.
    dotdash committed Jan 12, 2019
    Configuration menu
    Copy the full SHA
    42e996e View commit details
    Browse the repository at this point in the history