{"action":"created","issue":{"url":"https://api.github.com/repos/aframevr/aframe/issues/1323","repository_url":"https://api.github.com/repos/aframevr/aframe","labels_url":"https://api.github.com/repos/aframevr/aframe/issues/1323/labels{/name}","comments_url":"https://api.github.com/repos/aframevr/aframe/issues/1323/comments","events_url":"https://api.github.com/repos/aframevr/aframe/issues/1323/events","html_url":"https://github.com/aframevr/aframe/pull/1323","id":145462726,"number":1323,"title":"Refactors component updates to minimize the number of string parsings…","user":{"login":"dmarcos","id":39342,"avatar_url":"https://avatars.githubusercontent.com/u/39342?v=3","gravatar_id":"","url":"https://api.github.com/users/dmarcos","html_url":"https://github.com/dmarcos","followers_url":"https://api.github.com/users/dmarcos/followers","following_url":"https://api.github.com/users/dmarcos/following{/other_user}","gists_url":"https://api.github.com/users/dmarcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarcos/subscriptions","organizations_url":"https://api.github.com/users/dmarcos/orgs","repos_url":"https://api.github.com/users/dmarcos/repos","events_url":"https://api.github.com/users/dmarcos/events{/privacy}","received_events_url":"https://api.github.com/users/dmarcos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aframevr/aframe/labels/needs%20review","name":"needs review","color":"e1fd39"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-03T06:58:07Z","updated_at":"2016-04-12T18:18:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aframevr/aframe/pulls/1323","html_url":"https://github.com/aframevr/aframe/pull/1323","diff_url":"https://github.com/aframevr/aframe/pull/1323.diff","patch_url":"https://github.com/aframevr/aframe/pull/1323.patch"},"body":"Attributes updates is the most common operation in a-frame scenes. I've been looking for performance bottlenecks on setAttribute/getAttribute calls. Using the DOM to store the current state of the component incurs in a lot of component data stringifications (to feed the DOM attribute via HTMLElement.prototype.setAttribute) and parse calls to recalculate the component data from the attribute string or when getAttribute is called by the application logic. By caching the parsed attribute corresponding to the component we can save a lot of stringify/parse calls. The overhead is specially noticeable on scenes with a lot of dynamic behavior. I've added a stress test to illustrate the problem and show the performance gains. In the ```stress-animation``` demo I create a lot of elements with animations that will call ```setAttribute``` continuously. On my machine and without the patch the example runs in the lows-mids 20s FPS. With this patch applied it goes up to the lows-mids 30s FPS. That's approximately a 50% perf gain."},"comment":{"url":"https://api.github.com/repos/aframevr/aframe/issues/comments/209039701","html_url":"https://github.com/aframevr/aframe/pull/1323#issuecomment-209039701","issue_url":"https://api.github.com/repos/aframevr/aframe/issues/1323","id":209039701,"user":{"login":"dmarcos","id":39342,"avatar_url":"https://avatars.githubusercontent.com/u/39342?v=3","gravatar_id":"","url":"https://api.github.com/users/dmarcos","html_url":"https://github.com/dmarcos","followers_url":"https://api.github.com/users/dmarcos/followers","following_url":"https://api.github.com/users/dmarcos/following{/other_user}","gists_url":"https://api.github.com/users/dmarcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarcos/subscriptions","organizations_url":"https://api.github.com/users/dmarcos/orgs","repos_url":"https://api.github.com/users/dmarcos/repos","events_url":"https://api.github.com/users/dmarcos/events{/privacy}","received_events_url":"https://api.github.com/users/dmarcos/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T18:18:08Z","updated_at":"2016-04-12T18:18:08Z","body":"@ngokevin the changes are in one of the comments. https://github.com/aframevr/aframe/pull/1323#issuecomment-208617407"}}