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

font/shaper: periodically reset LRU in cache to avoid slowdown #1777

Merged
merged 1 commit into from
May 18, 2024

Conversation

mitchellh
Copy link
Contributor

See: ziglang/zig#17851

Users were noticing that frame render times got slower over time. I believe (thanks to community for pointing it out) that this is partially the culprit.

This works around this issue by clearing and reinitializing the LRU after a certain number of evictions. When the Zig issue has a better resolution (either rehash() as a workaround or a better hash implementation overall) we can change this.

To be completely honest, I'm not sure if this is actually a Zig issue or if our LRU is just garbage. In any case, I'd like to merge this as a mitigation and continue to hunt down improvements.

Before

After 60s:

warning: rebuildCells time=32650us
warning: rebuildCells time=33434us
warning: rebuildCells time=34278us
warning: rebuildCells time=34355us
warning: rebuildCells time=36812us

After

After 60s:

warning: rebuildCells time=30163us
warning: rebuildCells time=25997us
warning: rebuildCells time=29742us
warning: rebuildCells time=30240us
warning: rebuildCells time=28794us
warning: rebuildCells time=27179us
warning: rebuildCells time=28480us

See: ziglang/zig#17851

Users were noticing that frame render times got slower over time. I
believe (thanks to community for pointing it out) that this is the
culprit.

This works around this issue by clearing and reinitializing the LRU
after a certain number of evictions. When the Zig issue has a better
resolution (either rehash() as a workaround or a better hash
implementation overall) we can change this.
@mitchellh mitchellh merged commit f72c2ac into main May 18, 2024
23 checks passed
@mitchellh mitchellh deleted the lru-slow branch May 18, 2024 14:21
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.

1 participant