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

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

Open
abrehamgezahegn opened this issue Aug 10, 2022 · 5 comments
Open

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

abrehamgezahegn opened this issue Aug 10, 2022 · 5 comments

Comments

@abrehamgezahegn
Copy link

abrehamgezahegn commented Aug 10, 2022

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.

@abrehamgezahegn
Copy link
Author

abrehamgezahegn commented Aug 10, 2022

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

@abrehamgezahegn
Copy link
Author

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

@timdown
Copy link
Owner

timdown commented Aug 12, 2022

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.

@abrehamgezahegn
Copy link
Author

abrehamgezahegn commented Aug 16, 2022

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

@abrehamgezahegn
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants