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

parse cache #3575

Merged
merged 3 commits into from
Oct 24, 2023
Merged

parse cache #3575

merged 3 commits into from
Oct 24, 2023

Conversation

willmcgugan
Copy link
Collaborator

I added an @lru_cache to parse_rules in a previous PR, for a decent speedup. On reflection, this was naive as there was additional state. This update adds a manual "parse cache", which is cleared if variables are update.

The startup time for demo.py went from 177ms to 126ms. Not too shabby.

The main reason this happens is that inherited CSS was parsed multiple times. I.e. the default CSS in widget.py.

@willmcgugan willmcgugan merged commit b679afd into main Oct 24, 2023
23 checks passed
@willmcgugan willmcgugan deleted the cache-css branch October 24, 2023 09:11
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