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

[base/properties]Cache values of AliasProperty where possible #6055

Merged
merged 6 commits into from
May 4, 2019

Conversation

pythonic64
Copy link
Contributor

Builds upon #5856 and aims to increase widgets performance by caching values of AliasProperty where possible.

@pythonic64
Copy link
Contributor Author

For case in kivy/uix/screenmanager.py I think we need another method in AliasProperty, like recache() which will call getter function and update the cache with new value or recache_and_dispatch() which will also dispatch the new value if it has changed.

@pythonic64
Copy link
Contributor Author

@tshirtman @KeyWeeUsr Can you take a look at this pull request?

kivy/core/window/__init__.py Show resolved Hide resolved
kivy/uix/carousel.py Outdated Show resolved Hide resolved
kivy/uix/scatter.py Outdated Show resolved Hide resolved
kivy/uix/recycleview/__init__.py Outdated Show resolved Hide resolved
kivy/uix/recycleview/__init__.py Outdated Show resolved Hide resolved
kivy/uix/recycleview/__init__.py Outdated Show resolved Hide resolved
kivy/uix/image.py Outdated Show resolved Hide resolved
kivy/uix/scatter.py Show resolved Hide resolved
kivy/uix/screenmanager.py Outdated Show resolved Hide resolved
kivy/uix/textinput.py Outdated Show resolved Hide resolved
@pythonic64
Copy link
Contributor Author

@tito What do you think about adding a recache method to AliasProperty?

@tito
Copy link
Member

tito commented Feb 18, 2019

@pythonic64 What rebase would do in your mind?

Anyway, just another couple of changes here and it would be ok.

tito
tito previously requested changes Feb 18, 2019
Copy link
Member

@tito tito left a comment

Choose a reason for hiding this comment

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

Just remove the couple of caching discussed in command and we're good to merge!

@pythonic64
Copy link
Contributor Author

@tito I didn't mentioned any rebasing, but I did ask about recache method:

@tito What do you think about adding a recache method to AliasProperty?

I think it should be added just to have a way to explicitly cache value returned by getter method of AliasProperty.

@pythonic64
Copy link
Contributor Author

Request should be good to merge now. I will investigate TextInput._lines_flags attribute to see if it can be changed to ListProperty and then we can use it to cache text property.

@pythonic64 pythonic64 force-pushed the cache_values_of_alias_properties branch from 716a8bd to 2ca1dac Compare May 2, 2019 13:43
@matham
Copy link
Member

matham commented May 2, 2019

Please let us know when you think it's in a good state to merge.

@pythonic64
Copy link
Contributor Author

@matham @tito You can merge this now.

@matham matham dismissed tito’s stale review May 4, 2019 15:46

Changes implemented

Copy link
Member

@matham matham left a comment

Choose a reason for hiding this comment

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

Seems to have implemented @tito 's changes so it looks ok.

@matham matham merged commit 2284c2a into kivy:master May 4, 2019
@matham matham changed the title Cache values of AliasProperty where possible [base/properties]Cache values of AliasProperty where possible May 23, 2019
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