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

Reduce memory usage and loading time of FontSystem #347

Closed

Conversation

HoldMyBeer1111
Copy link

Related to pop-os/cosmic-applets#723

Before

  • All monospace fonts get cached and per_script_monospace_font_ids is calculated even if monospace_fallback feature is turned off.
  • All monospace fonts get cached in advance. Memory usage is always high because caching reads all data from mmaped files for swash and rustybuzz.
  • Calculating per_script_monospace_font_ids leads to caching (get_font call).

After

In my testing app:

  • Initial loading time is reduced from 700ms to 70ms.
  • Memory usage is reduced from 600MB to 100MB.

@jackpot51
Copy link
Member

Applied in 166b59f, I just had to make a change for no_std support

@jackpot51 jackpot51 closed this Jan 10, 2025
@HoldMyBeer1111 HoldMyBeer1111 deleted the reduce-mem-usage-load-time branch January 10, 2025 18:46
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

Successfully merging this pull request may close these issues.

2 participants