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

Add a cache for MinSize in BaseWidget #4827

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Jacalz
Copy link
Member

@Jacalz Jacalz commented May 2, 2024

Description:

This attempts to cache MinSize values of widgets to provide for faster lookups by avoiding recalculations when nothing has changed. I think it feels quite a bit faster when just using fyne_demo. Placebo?

Supersedes #4681

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Where applicable:

  • Public APIs match existing style and have Since: line.

@coveralls
Copy link

coveralls commented May 2, 2024

Coverage Status

coverage: 64.975% (-0.005%) from 64.98%
when pulling e3095b9 on Jacalz:minsize-caching
into 0f09fc6 on fyne-io:develop.

min := t.BaseWidget.MinSize()
t.minCache = min
return min
// We don't return the cached value as any internal segments could have caused it to change...
Copy link
Member Author

@Jacalz Jacalz May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should likely fix this as it kind of goes against the idea of refreshing a widget when it changes state. Sounds like a bug but it isn't new behaviour to this PR so I'll let it slide for now.

@toaster
Copy link
Member

toaster commented May 3, 2024

I thought, that I had added some sort of minSize cache back in the days when I worked on the walkers, didn’t I?

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.

3 participants