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

Improve performance #3

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

Improve performance #3

wants to merge 2 commits into from

Conversation

An-dz
Copy link
Contributor

@An-dz An-dz commented Aug 31, 2016

localStorage is not needed in this extension, creating an object in root level is enough and much faster.

@Christoph142
Copy link
Owner

Global variables are always a bad idea. It could possibly conflict with foreign code.
Did you measure of what magnitude the performance gain is to justify this?

@An-dz
Copy link
Contributor Author

An-dz commented Aug 31, 2016

I've just measured on your extension and the difference is negligible, no changes. On my extension I had better performances because I use it for more data.

Anyway, there's no problem creating a global variable, this is the background page, it does not conflict with foreign code because foreign code never runs on it and the background never runs on foreign code. This is just a problem with userScripts.

And if you still want to use it I recommend changing to sessionStorage, this way you can remove localStorage.clear()

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.

2 participants