You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some cases where markuplint is slow, especially when a file contains hundreds of nodes. It takes a few seconds to lint a single HTML file on my machine.
Although the bottlenecks can vary depending on the DOM structure, enabled rules, and configuration, I have identified two functionalities that can be sped up with little effort:
Role computation
Role computation is a compute-intensive process, and the same inputs always produce the same output (role). Caching the results can boost the performance of a few linting rules, including require-accessible-name.
Selector matching
A simple selector will never match if one or more parts of the selector don't match.
For example, input[type=button] will never match button[type=button] because input doesn't match button. Hence, we can skip the [type=button] matching.
Since these optimizations should not change the results, I'm not planning to add new tests and would like to check if the existing tests have passed. If this is acceptable, I can open the pull requests.
The text was updated successfully, but these errors were encountered:
I am facing the same issue.
In my case, it is with about 1500 option elements in a datalist element that I am auto-generating.
Markuplint takes more than 20 seconds to check this.
For now, we are avoiding the issue by adding it to the ignore file.
The file I am encountering the issue with is located here.
I have investigated how the execution time scales with the number of option elements as additional information.
It appears that the execution time is not at least O(N) in relation to the number of elements.
There are some cases where markuplint is slow, especially when a file contains hundreds of nodes. It takes a few seconds to lint a single HTML file on my machine.
Although the bottlenecks can vary depending on the DOM structure, enabled rules, and configuration, I have identified two functionalities that can be sped up with little effort:
Role computation
Role computation is a compute-intensive process, and the same inputs always produce the same output (role). Caching the results can boost the performance of a few linting rules, including require-accessible-name.
Selector matching
A simple selector will never match if one or more parts of the selector don't match.
For example,
input[type=button]
will never matchbutton[type=button]
becauseinput
doesn't matchbutton
. Hence, we can skip the[type=button]
matching.Since these optimizations should not change the results, I'm not planning to add new tests and would like to check if the existing tests have passed. If this is acceptable, I can open the pull requests.
The text was updated successfully, but these errors were encountered: