Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This draft PR should address the performance issue of
hint-mode
which significantly slows down hint overlays rendering when performing thefollow-hint
command in a page with thousands of hintable elements.Fixes #3254
Discussion
The change that has been introduced so far is to separate the
flet
declared function in the macrosnyxt/ps:rqsa
andnyxt/ps:rqs-nyxt-id
which is suspected to cause some delay, considering that a lambda function has to be declared during every call to these two macros.I have also optimized the two recursive functions which are now macros. Instead of walking through all DOM elements to check for shadow root elements, a query is now performed using the existing custom class
nyxt-shadow-root
. Note that there's still need to confirm that this change does not introduce any regression bugs, so I would like to ask for more guidance about how to write a test forhint-mode
.Apparently, the performance hasn't improved much compared to using the macros
qsa
andqs-nyxt-id
. The next part that I will try to tackle is the call tonyxt/ps:rqs-nyxt-id
in the functionnyxt/mode/hint:hint-elements
, I will try see whether it would be possible to refactor that part of the code.Checklist:
Everything in this checklist is required for each PR. Please do not approve a PR that does not have all of these items.
cd /path/to/nyxt/checkout git submodule add https://gitlab.common-lisp.net/nyxt/py-configparser _build/py-configparser
:documentation
s written in the aforementioned style. (It's OK to skip the docstring for really trivial parts.)changelog.lisp
with my changes if it's anything user-facing (new features, important bug fix, compatibility breakage).migration.lisp
entry for all compatibility-breaking changes.(asdf:test-system :nyxt)
and(asdf:test-system :nyxt/gi-gtk)
) and they pass.