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

Optimizing the apply function #231

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

KoenPasman
Copy link

I integrated a custom serializer and deserializer (in order to put gzip the content using lz-string lib). However, changing a certain setting caused all the keys to get reset in localStorage. Besides the entry that needs changing, also other entries are refreshed where this is not needed. Combine that with a rather slow/expensive compress function, this leads to performance degradation.

The PR checks if the key is actually changed before resetting it in the storageProvider.

@KoenPasman
Copy link
Author

KoenPasman commented Jul 22, 2016

I'm not sure why the test is failing, it looks like the $apply function is used in other usecases as well. Maybe someone can shed some light on that?

… when it's different from its previous version. Do delete the tempstorage reference.
@KoenPasman
Copy link
Author

Allright! I managed to get the optimization working without breaking the tests. The problem was that the tempstorage reference always needs to be deleted, even if we don't persist the value into storage.

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