Skip to content

TextRange's findText() method is very slow #476

Description

@abrehamgezahegn

The findText() method of the TextRange module takes about 200ms to run and around 300ms on 6x throttle on chrome . This causes lag if the method is called done multiple times or even a few times.

Activity

  1. abrehamgezahegn commented on Aug 10, 2022

    @abrehamgezahegn
    Author

    I have found that findText() performs well if the text is found and takes 10x+ more time if the text isn't found.

  2. abrehamgezahegn commented on Aug 12, 2022

    @abrehamgezahegn
    Author

    Since @timdown isn't supporting the repo. If anyone is interested to pair program this issue please comment below.

  3. timdown commented on Aug 12, 2022

    @timdown
    Owner

    I'm having a tidy-up and PR review and intend to release a new minor version early next week, after which it may make sense to find a new maintainer. I will look into some issues as well but I'm not anticipating being able to do much about this one: the TextRange module is just very slow.

  4. abrehamgezahegn commented on Aug 16, 2022

    @abrehamgezahegn
    Author

    Hello @timdown ! Thanks for reaching out. If I were to optimize the findText() function in the TextRange module. Where would you recommend I start?

  5. abrehamgezahegn commented on Aug 16, 2022

    @abrehamgezahegn
    Author

    As I understand it,

    1. When the text is found: it's performance is good / optimal
    2. When the text isn't found: keeps looking for the text in the subsequent elements than the specified element. Which makes it slow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions