Is your feature request related to a problem? Please describe.
The field cache stores the computed text length for SVG strings. We turn it on and off regularly, which means that we are missing some of the benefits of caching.
Describe the solution you'd like
- Turn the field cache on when injecting
- Add a limit to the size of the field cache and/or periodically trim the cache to make sure it doesn't get out of control.
Describe alternatives you've considered
- Turn the cache on at the beginning of major operations like loading workspaces (we may already do this)
Additional context
Scratch team did this a while back. Blockly then ate all of the available memory because it was unbounded, but that should be a simple fix
This is especially effective if there are lots of copies with the same text.
A shockingly large amount of our rendering time goes to measuring text.
Is your feature request related to a problem? Please describe.
The field cache stores the computed text length for SVG strings. We turn it on and off regularly, which means that we are missing some of the benefits of caching.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
Scratch team did this a while back. Blockly then ate all of the available memory because it was unbounded, but that should be a simple fix
This is especially effective if there are lots of copies with the same text.
A shockingly large amount of our rendering time goes to measuring text.