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
Move GM_setValue storage #1798
Comments
#1768 ? I have a size of a few MB... Otherwise: From: var valueGM = (typeof GM_setValue === "function"); // etc.
var valueLS = ("localStorage" in window && window.localStorage != null); To: // var valueGM = (typeof GM_setValue === "function"); // etc.
var valueGM = false;
var valueLS = ("localStorage" in window && window.localStorage != null); Or: From: // @grant GM_setValue etc. To:
But the text is the text (prefs.js) :-/ |
Wherever this gets moved to, it would be really nice to have the storage more structured; i.e. the script ID and the value name stored separately. |
Values are not properly migrated upon script update/reinstall. |
Since the values are now stored in a file alongside the script, there's no practical place to keep them on uninstall anymore. I.E. Always remove them on uninstall. Refs greasemonkey#1798
Except in one legacy migration codepath. Values are now stored in per-script DBs instead. Refs greasemonkey#1798
Reopening to confirm working behavior on Windows (locking file systems .....!!!!!). |
I don't know why yet but I'm rarely seeing:
Errors logged. Never while I'm doing things, but lots when I'm idle for a while and come back. |
Can anything be done about the freezes that occur when writing to values.db? |
First: thanks very much for your feedback about beta releases! It's hard for me to accurately simulate/expect real user behavior. In an attempt to get some objective data I threw this script together: It does a benchmark of get/set calls. With GM 1.12, it outputs:
Then I tried with the latest 1.13 beta (5 at this time). I got the fifth or sixth unresponsive script popup and gave up. I had to drop the iterations way down to avoid them, and then:
That means that get operations went from If you've got spare time, could you check what sort of results you get? |
Setting
Which makes set 3.9ms (under 5% of the run time). Setting
Worse than WAL!? Hardly any better than we started with. I had tried WAL briefly early on, but it seemed to produce giant DB files. That might have been a poor/snap judgment. |
Thanks for actually looking into it. 1.12:
1.13b5:
In my case writing was 1500x slower. I can't build the xpi myself so I can only hope that WAL mode is fast enough to get rid of the problem. |
Version 1.13beta6 has been uploaded. Let me know if this performs any better, and if so, if that's good enough. |
It's working great. No freezes during scrolling at all now. Thanks for the fix. |
Unused constant: 47bc190#commitcomment-5003232 |
https://bugzilla.mozilla.org/show_bug.cgi?id=872981
https://blog.mozilla.org/addons/2013/09/03/compatibility-for-firefox-24/
There's probably some scripts setting big values (if big is >4KB). If we get ahead of this they might not break.
The text was updated successfully, but these errors were encountered: