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

sugar3.graphics.icon has a tiny LRU cache for SVGs and surfaces #374

Open
1 of 5 tasks
quozl opened this issue Jan 6, 2018 · 0 comments
Open
1 of 5 tasks

sugar3.graphics.icon has a tiny LRU cache for SVGs and surfaces #374

quozl opened this issue Jan 6, 2018 · 0 comments

Comments

@quozl
Copy link
Contributor

quozl commented Jan 6, 2018

Icon class has a very small LRU cache for SVGs and surfaces.

SVGs are not being cached; the cache attribute is not set by the callers.

Up to 50 surfaces are cached.

Initial demand is about 10 surfaces for the toolbar standard UI items. Each additional UI object with an SVG brings the activity closer to the limit. Once the limit is reached, the LRU cache can lose critical surfaces, and several user actions cause re-read and reprocessing of SVGs, resulting in slow response in the user interface. Effectively trading memory usage for CPU usage.

Icon class is used by many other classes.

  • double the cache sizes and test on oldest used hardware, aaea860,
  • set up an intentionally limited virtual machine, or old hardware,
  • make performance measurements with varying cache sizes,
  • recommend a changed cache size,
  • recommend a changed cache algorithm (e.g. use reference counters).

Discovered while experimenting with the Icon class for the Chat activity smiley window. When more than 50 instances of Icon were created, hiding and showing the window took ten seconds, and scrolling took five seconds. Gtk.Image was used instead, see sugarlabs/chat@0f09a26.

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