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

Improve emoji SVG parsing by caching #100300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

edwin0cheng
Copy link

@edwin0cheng edwin0cheng commented Dec 12, 2024

This PR adds a cache for SVG parsing in the Text Server.

Basically, when we first encounter the document, we parse it as before, but we also note the offsets of other glyphs and store the remaining XML. The next time we see another glyph, we can simply parse that glyph node and insert it back into the stored XML.

Although it is still very slow in the case mentioned in #100278 (which is related to font rendering), the time difference is still significant (on my machine):

Before : 4 mins +
After: 35 secs

@edwin0cheng edwin0cheng requested a review from a team as a code owner December 12, 2024 05:21
@bruvzg bruvzg self-requested a review December 12, 2024 05:48
@YeldhamDev YeldhamDev added this to the 4.x milestone Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants