Skip to content

Investigate making the field cache more permanent #3112

Description

@rachel-fenichel

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    • Status
      Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions