question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance of dom.findUp is very slow

See original GitHub issue

As you know, the performance of dom.findUp is really poor. However it is used very heavily across the various rules/checks.

AFAICT, you could use the DOM API of element.matches() which should be substantially faster. (browser support is good).

You basically have written the polyfill for it, so you can fall back to your current implementation if ('matches' in element) is false.


Good site to reproduce on: https://www.mlb.com/ Screenshot of the color-contrast rule taking 26s to complete. (All of the time is spent in the querySelectorAll within findUp)

cc @patrickhulce @kdzwinel

image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19 (13 by maintainers)

github_iconTop GitHub Comments

7reactions
dylanbcommented, Jan 27, 2018

This is a fantastic improvement. It gets the time for the mlb.com home page down to around 14s from 28s - that is an improvement of 50% overall…thanks for the help @paulirish @patrickhulce and @kdzwinel

2reactions
kdzwinelcommented, Jan 25, 2018

I just tested and on https://www.mlb.com/yankees/schedule/2018-03` axe runtime is down from 60s+ (LH has a 60s timeout for gatherers) to 29s 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is the DOM so slow? | Handmade Network
first, no matter what I do in my tests, getting data into the DOM (not doing a layout and render!) is about 3x...
Read more >
Large DOM Tree Slowing Down jQuery Click Events
The problem I'm having is that the click events get slower and slower as the DOM tree grows larger. The delay is currently...
Read more >
Traversing DOM very very slow - Oracle Communities
I've an XML Document quite big (240K) with a root, 800 first level nodes and an average of 6-10 second level nodes for...
Read more >
gulfstream result
On this page, you'll find up-to-date racing results from ... it took 517 ms to load all DOM resources and completely render a...
Read more >
Things Heard And Seen Imdb - altiningramfiyati.com
Directors Shari Springer Berman Robert Pulcini Think you re a movie buff The ... odkrywa że zarówno jej mąż jak i nowy dom...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found