-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Conversation
52402de
to
025ef85
Compare
Seem like Windows build fail due to using designated initializers 😞 |
9fcebc1
to
05bddda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and works as expected.
The same change should be also applied to modules/text_server_fb/thorvg_svg_in_ot.*
(exactly same code).
And I add fb textserver part too. |
Not sure if a lot can be done for pre-rendering, pre-rendering option only exist because it is slow and primarily for MSDF, it should not be used for emojis in a first place. #88809 actually is not fully related, it's likely caused by fallback lookup for the most part. |
Looks good! Could you squash the commits? See PR workflow for instructions. |
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.
e97548b
to
61d3871
Compare
@akien-mga Sure, Done. |
Thanks! And congrats for your first merged Godot contribution 🎉 |
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
Fixes #100278