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

Faster query_one #4950

Merged
merged 12 commits into from
Aug 28, 2024
Merged

Faster query_one #4950

merged 12 commits into from
Aug 28, 2024

Conversation

willmcgugan
Copy link
Collaborator

@willmcgugan willmcgugan commented Aug 28, 2024

A faster query_one.

  • Exit when a match is found, without iterating the full DOM
  • Caches simple queries (containing just IDs or types)
  • Optimizes get_widget_by_id by going through query_one

@willmcgugan willmcgugan changed the title Faster query_one WIP Faster query_one Aug 28, 2024
@willmcgugan willmcgugan changed the title WIP Faster query_one Faster query_one Aug 28, 2024
src/textual/dom.py Outdated Show resolved Hide resolved
@willmcgugan willmcgugan merged commit 58d25fb into main Aug 28, 2024
20 checks passed
@willmcgugan willmcgugan deleted the faster-query branch August 28, 2024 16:08
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

Successfully merging this pull request may close these issues.

2 participants