{"action":"created","issue":{"url":"https://api.github.com/repos/nengo/nengo_gui/issues/674","repository_url":"https://api.github.com/repos/nengo/nengo_gui","labels_url":"https://api.github.com/repos/nengo/nengo_gui/issues/674/labels{/name}","comments_url":"https://api.github.com/repos/nengo/nengo_gui/issues/674/comments","events_url":"https://api.github.com/repos/nengo/nengo_gui/issues/674/events","html_url":"https://github.com/nengo/nengo_gui/pull/674","id":132251733,"number":674,"title":"Optimize display","user":{"login":"drasmuss","id":1952220,"avatar_url":"https://avatars.githubusercontent.com/u/1952220?v=3","gravatar_id":"","url":"https://api.github.com/users/drasmuss","html_url":"https://github.com/drasmuss","followers_url":"https://api.github.com/users/drasmuss/followers","following_url":"https://api.github.com/users/drasmuss/following{/other_user}","gists_url":"https://api.github.com/users/drasmuss/gists{/gist_id}","starred_url":"https://api.github.com/users/drasmuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drasmuss/subscriptions","organizations_url":"https://api.github.com/users/drasmuss/orgs","repos_url":"https://api.github.com/users/drasmuss/repos","events_url":"https://api.github.com/users/drasmuss/events{/privacy}","received_events_url":"https://api.github.com/users/drasmuss/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nengo/nengo_gui/labels/needs%20merge","name":"needs merge","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-02-08T20:44:07Z","updated_at":"2016-02-10T02:37:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nengo/nengo_gui/pulls/674","html_url":"https://github.com/nengo/nengo_gui/pull/674","diff_url":"https://github.com/nengo/nengo_gui/pull/674.diff","patch_url":"https://github.com/nengo/nengo_gui/pull/674.patch"},"body":"This addresses #276 (lag on firefox when dragging around large networks).  It's still a little bit choppy when dragging a big network around, but significantly improved from what it was like before.\r\n\r\nThe first improvement comes from only updating the minimap when it is being displayed.  Before we were updating it all the time, so we were effectively doing twice as many updates/redraws as necessary.\r\n\r\nThe most significant change to the code-base here is that I modified the minimap logic so that the main object takes care of keeping the minimap object up to date (rather than the old method, where the overall netgraph took care of updating both the main objects and the minimap objects).  This means that there is only one place where we need to check if the minimap is open, rather than having to remember to put that check in everywhere we update the object.\r\n\r\nThe second improvement comes from reducing the number of jquery calls we're making, as those are kind of expensive.  Basically this just involves storing the jquery result in a local variable when we query it (in response to something changing), and then everything else just references that local variable instead of redoing the jquery.  (note: I only did this in `netgraph.js` and `netgraph_item.js`; there are likely other areas of the code that could benefit from the same treatment)."},"comment":{"url":"https://api.github.com/repos/nengo/nengo_gui/issues/comments/182172993","html_url":"https://github.com/nengo/nengo_gui/pull/674#issuecomment-182172993","issue_url":"https://api.github.com/repos/nengo/nengo_gui/issues/674","id":182172993,"user":{"login":"tcstewar","id":2380772,"avatar_url":"https://avatars.githubusercontent.com/u/2380772?v=3","gravatar_id":"","url":"https://api.github.com/users/tcstewar","html_url":"https://github.com/tcstewar","followers_url":"https://api.github.com/users/tcstewar/followers","following_url":"https://api.github.com/users/tcstewar/following{/other_user}","gists_url":"https://api.github.com/users/tcstewar/gists{/gist_id}","starred_url":"https://api.github.com/users/tcstewar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcstewar/subscriptions","organizations_url":"https://api.github.com/users/tcstewar/orgs","repos_url":"https://api.github.com/users/tcstewar/repos","events_url":"https://api.github.com/users/tcstewar/events{/privacy}","received_events_url":"https://api.github.com/users/tcstewar/received_events","type":"User","site_admin":false},"created_at":"2016-02-10T02:37:45Z","updated_at":"2016-02-10T02:37:45Z","body":"> I'd do that just for fun, optimization is like popping bubble wrap .\r\n\r\nWow did we hire the right person.  ;)"}}