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 extreme TextInput slowness on Android #19645

Closed
wants to merge 1 commit into from

Commits on Jun 27, 2018

  1. Fix extreme TextInput slowness on Android

    Because NaN is special, the `!=` version of this condition will
    always be true -- even if `mLetterSpacing` is also `Float.NaN`, which
    is its default value.  It should instead be `!Float.isNaN(...)`.
    
    The effect of the broken condition is that every text shadow node will
    create a `CustomLetterSpacingSpan` around its contents, even when the
    `letterSpacing` prop was never set.
    
    Empirically, that in turn causes facebook#19126: in a controlled TextInput
    after some text is first added, then deleted, further interaction
    with the TextInput becomes extremely slow.  Perhaps we're somehow
    ending up with large numbers of these shadow nodes (that sounds like
    a bug in itself, but I guess it's normally low-impact); then this
    code would have caused them each to generate more work to do.  In
    any case, fixing this condition causes that issue to disappear.
    
    The affected logic was introduced between v0.54 and v0.55, in facebook#17398
    aka 5898817 "Implement letterSpacing on Android >= 5.0".
    
    Fixes facebook#19126.
    gnprice committed Jun 27, 2018
    Configuration menu
    Copy the full SHA
    ec47acf View commit details
    Browse the repository at this point in the history