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

Zhudi renders slowly #43

Open
lindenr opened this issue Nov 2, 2023 · 0 comments
Open

Zhudi renders slowly #43

lindenr opened this issue Nov 2, 2023 · 0 comments

Comments

@lindenr
Copy link
Contributor

lindenr commented Nov 2, 2023

Showing definitions can take a very long time, depending on the word. I did a bit of profiling and it turns out the _format_codes function is to blame, probably because it searches the whole db for every character. I think it would be better to do one db search on startup, and keep a dictionary of (character) -> (code) in memory. What do you think?

For now I've just made _format_codes return an empty string in my local build and it runs much faster! :)

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

No branches or pull requests

1 participant