{"action":"created","issue":{"url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/2197","repository_url":"https://api.github.com/repos/greasemonkey/greasemonkey","labels_url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/2197/labels{/name}","comments_url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/2197/comments","events_url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/2197/events","html_url":"https://github.com/greasemonkey/greasemonkey/issues/2197","id":87433125,"number":2197,"title":"GM_setValue() can be slow","user":{"login":"ArkadiuszMichalski","id":2730894,"avatar_url":"https://avatars.githubusercontent.com/u/2730894?v=3","gravatar_id":"","url":"https://api.github.com/users/ArkadiuszMichalski","html_url":"https://github.com/ArkadiuszMichalski","followers_url":"https://api.github.com/users/ArkadiuszMichalski/followers","following_url":"https://api.github.com/users/ArkadiuszMichalski/following{/other_user}","gists_url":"https://api.github.com/users/ArkadiuszMichalski/gists{/gist_id}","starred_url":"https://api.github.com/users/ArkadiuszMichalski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArkadiuszMichalski/subscriptions","organizations_url":"https://api.github.com/users/ArkadiuszMichalski/orgs","repos_url":"https://api.github.com/users/ArkadiuszMichalski/repos","events_url":"https://api.github.com/users/ArkadiuszMichalski/events{/privacy}","received_events_url":"https://api.github.com/users/ArkadiuszMichalski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/greasemonkey/greasemonkey/milestones/71","html_url":"https://github.com/greasemonkey/greasemonkey/milestones/3.9","labels_url":"https://api.github.com/repos/greasemonkey/greasemonkey/milestones/71/labels","id":1714196,"number":71,"title":"3.9","description":"","creator":{"login":"arantius","id":84729,"avatar_url":"https://avatars.githubusercontent.com/u/84729?v=3","gravatar_id":"","url":"https://api.github.com/users/arantius","html_url":"https://github.com/arantius","followers_url":"https://api.github.com/users/arantius/followers","following_url":"https://api.github.com/users/arantius/following{/other_user}","gists_url":"https://api.github.com/users/arantius/gists{/gist_id}","starred_url":"https://api.github.com/users/arantius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arantius/subscriptions","organizations_url":"https://api.github.com/users/arantius/orgs","repos_url":"https://api.github.com/users/arantius/repos","events_url":"https://api.github.com/users/arantius/events{/privacy}","received_events_url":"https://api.github.com/users/arantius/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":16,"state":"open","created_at":"2016-04-18T16:02:45Z","updated_at":"2016-08-02T19:03:13Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-06-11T18:06:18Z","updated_at":"2016-08-02T19:06:13Z","closed_at":null,"body":"Hi, I see that function GM_setValue()  can hang browser for short time, but its noticable.\r\n\r\nI made on page some timer with output to DIV elapsed milisecond (update with setInterval and 100ms). After this I run GM_setValue() in loop 14 times (saving only small numbers as string, like 3.14+\"\") and see that my timer is freeze and scrolling page too. But this can be easy fixed, just check if new value is different than old value taked by GM_getValue(), and if yes then invoke GM_setValue(), in other case don't do this.\r\n\r\nIts normal that  GM_setValue() takes much more cost than GM_getValue()? If yes then cold you somehow optimized it out-of the box?\r\n\r\nEdit:\r\nGet some time to compare this two method (all in ms)\r\nGM_getValue(): 9, 13, 12, 14, 15 \r\nGM_setValue(): 398, 330, 357, 315, 371\r\n"},"comment":{"url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/comments/237009696","html_url":"https://github.com/greasemonkey/greasemonkey/issues/2197#issuecomment-237009696","issue_url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/2197","id":237009696,"user":{"login":"arantius","id":84729,"avatar_url":"https://avatars.githubusercontent.com/u/84729?v=3","gravatar_id":"","url":"https://api.github.com/users/arantius","html_url":"https://github.com/arantius","followers_url":"https://api.github.com/users/arantius/followers","following_url":"https://api.github.com/users/arantius/following{/other_user}","gists_url":"https://api.github.com/users/arantius/gists{/gist_id}","starred_url":"https://api.github.com/users/arantius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arantius/subscriptions","organizations_url":"https://api.github.com/users/arantius/orgs","repos_url":"https://api.github.com/users/arantius/repos","events_url":"https://api.github.com/users/arantius/events{/privacy}","received_events_url":"https://api.github.com/users/arantius/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T19:06:13Z","updated_at":"2016-08-02T19:06:13Z","body":"I re-wrote (because I couldn't find my previous version) a benchmark for testing `GM_*Value` performance:  https://gist.github.com/arantius/3dc011a041e6205648fcddb7131af085\r\n\r\nAs noted in that source, I'm currently seeing set take roughly 30ms, while get takes roughly a half of one ms."}}
{"actor":{"display_login":"arantius"}}