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

Reducing overhead in segmentation #18

Closed
aruneshmathur opened this issue Nov 13, 2018 · 4 comments
Closed

Reducing overhead in segmentation #18

aruneshmathur opened this issue Nov 13, 2018 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@aruneshmathur
Copy link
Owner

@gunesacar pointed out that our segmentation algorithm makes repeated calls to getBoundingClientRect() for element width/height. This function call is expensive and adds significant overhead.

We need to avoid making repeated calls to getBoundingClientRect(), and reuse its output where we can.

@aruneshmathur aruneshmathur added the enhancement New feature or request label Nov 13, 2018
@aruneshmathur aruneshmathur self-assigned this Nov 13, 2018
@gunesacar
Copy link
Collaborator

gunesacar commented Nov 14, 2018

Depending on the site, new segmentation takes up to a second:

nba.com
new: 1038ms
old: 6ms

google.com
new: 14ms
old: 2ms

princeton.edu
new: 142
old: 6

@aruneshmathur
Copy link
Owner Author

I'll try to optimize the calls as you suggested.

@aruneshmathur
Copy link
Owner Author

Should be much faster with the latest update. Tested on Firefox 52 ESR.

@aruneshmathur
Copy link
Owner Author

@gunesacar Safe to say this is reasonable now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants