{"action":"created","issue":{"url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/3486","labels_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/3486/labels{/name}","comments_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/3486/comments","events_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/3486/events","html_url":"https://github.com/HabitRPG/habitrpg/issues/3486","id":33754513,"number":3486,"title":"Running very slow in Chrome","user":{"login":"leephon","id":7176271,"avatar_url":"https://avatars.githubusercontent.com/u/7176271?v=3","gravatar_id":"","url":"https://api.github.com/users/leephon","html_url":"https://github.com/leephon","followers_url":"https://api.github.com/users/leephon/followers","following_url":"https://api.github.com/users/leephon/following{/other_user}","gists_url":"https://api.github.com/users/leephon/gists{/gist_id}","starred_url":"https://api.github.com/users/leephon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leephon/subscriptions","organizations_url":"https://api.github.com/users/leephon/orgs","repos_url":"https://api.github.com/users/leephon/repos","events_url":"https://api.github.com/users/leephon/events{/privacy}","received_events_url":"https://api.github.com/users/leephon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/HabitRPG/habitrpg/labels/performance","name":"performance","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":50,"created_at":"2014-05-18T16:08:59Z","updated_at":"2015-06-25T15:42:21Z","closed_at":null,"body":"When I run HabitRPG in Chrome (Version 34.0.1847.137 m), my preferred browser, it runs extremely slow (2-10 seconds before clicks get responses, especially bad on inventory and chat pages).  This is particularly aggravating while typing in a chat box. The cursor stops and takes several seconds to start again, though it usually gets all that I typed.  To me, this makes it unusable.  Fortunately, it's running fine in Firefox (29.0.1).   \r\n\r\nUUID 8715b971-500b-4e81-a445-0196eb3ef5cb\r\n\r\n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2217207-running-very-slow-in-chrome?utm_campaign=plugin&utm_content=tracker%2F68393&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F68393&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/comments/115298755","html_url":"https://github.com/HabitRPG/habitrpg/issues/3486#issuecomment-115298755","issue_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/3486","id":115298755,"user":{"login":"Andrux51","id":1361066,"avatar_url":"https://avatars.githubusercontent.com/u/1361066?v=3","gravatar_id":"","url":"https://api.github.com/users/Andrux51","html_url":"https://github.com/Andrux51","followers_url":"https://api.github.com/users/Andrux51/followers","following_url":"https://api.github.com/users/Andrux51/following{/other_user}","gists_url":"https://api.github.com/users/Andrux51/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrux51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrux51/subscriptions","organizations_url":"https://api.github.com/users/Andrux51/orgs","repos_url":"https://api.github.com/users/Andrux51/repos","events_url":"https://api.github.com/users/Andrux51/events{/privacy}","received_events_url":"https://api.github.com/users/Andrux51/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T15:42:21Z","updated_at":"2015-06-25T15:42:21Z","body":"Another thing, the pages with long content (guilds, challenges, tavern, etc) could have improved performance by implementing pagination. Instead of traditional pagination (like google search, for example) I would suggest an infinite scroll effect (like twitter, facebook, etc.)\r\n\r\nBootstrap has a Scrollspy jquery plugin built in which can be used to easily handle this style of pagination - basically, the idea would be to initially load a page of [25?] records, then after scrolling past about 1/5 of the records, load another page.\r\n\r\n[Bootstrap Scrollspy](http://getbootstrap.com/javascript/#scrollspy)\r\n\r\nPseudocode (obviously some tweaking will be needed, but this is the basic idea)\r\n```\r\nvar spyScrollId = (page*pageSize) + (pageSize/5);\r\n\r\n$('body').scrollspy({ target: '.spy-'+spyScrollId });\r\n\r\n$('body').on('activate.bs.scrollspy', function() { \r\n    // fetch another page from the api\r\n    // something like:\r\n    $http.get('/api/v2/challenges?skip='+page*pageSize+'&take='+pageSize,\r\n        function(data) { \r\n            // load data into DOM here\r\n    })\r\n    page++;\r\n    spyScrollId = (page*pageSize) + (pageSize/5);\r\n    $('body').scrollspy({ target: '.spy-'+spyScrollId });\r\n\r\n    // this is necessary when adding DOM elements\r\n    $('[data-spy=\"scroll\"]').each(function () {\r\n        var $spy = $(this).scrollspy('refresh')\r\n    });\r\n});\r\n```"}}