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

Insane boost in TextGrid performance for intense usage of the widget #4021

Merged
merged 2 commits into from
Jul 4, 2023

Conversation

andydotxyz
Copy link
Member

@andydotxyz andydotxyz commented Jul 4, 2023

It was difficult to write a benchmark as you're balancing the CPU and GPU usage which was lowering the apparent frame rate.
However loading this change into FyneTerm and listing a huge directory used to take around a second, but now it is so fast as to compare with native terminals!!!

I think this does all we can for the referenced issue, to some extend the newline parse on SetText cannot be avoided, but FyneTerm does show how to be a little lower level for greater speed.

Fixes #3994 and #3142

Checklist:

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

We could be calling this 100s or 1000s of times if the entire text grid was refreshed
(up to twice for each cell, possibly faster than refresh rate because this in the event thread not draw).

Result is huge boost (see fyneterm usage for example)
@coveralls
Copy link

Coverage Status

coverage: 66.162% (+0.005%) from 66.157% when pulling 47cac54 on andydotxyz:fix/slowtextgrid into f73816f on fyne-io:develop.

@Jacalz
Copy link
Member

Jacalz commented Jul 4, 2023

Did you forget to push the tests? The checkbox is checked but I don't see any in the diff.

@andydotxyz
Copy link
Member Author

Apologies it was a mistake, I wasn't able to figure out how to demonstrate the improvement outside fyneterm

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

Okidoki, sounds sensible :)

@andydotxyz andydotxyz merged commit e050d79 into fyne-io:develop Jul 4, 2023
@andydotxyz andydotxyz deleted the fix/slowtextgrid branch July 4, 2023 20:33
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