{"action":"closed","issue":{"url":"https://api.github.com/repos/aframevr/aframe/issues/1626","repository_url":"https://api.github.com/repos/aframevr/aframe","labels_url":"https://api.github.com/repos/aframevr/aframe/issues/1626/labels{/name}","comments_url":"https://api.github.com/repos/aframevr/aframe/issues/1626/comments","events_url":"https://api.github.com/repos/aframevr/aframe/issues/1626/events","html_url":"https://github.com/aframevr/aframe/issues/1626","id":164864235,"number":1626,"title":"Performance problems on tour app - am I doing something wrong?","user":{"login":"rafaeleyng","id":4842605,"avatar_url":"https://avatars.githubusercontent.com/u/4842605?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaeleyng","html_url":"https://github.com/rafaeleyng","followers_url":"https://api.github.com/users/rafaeleyng/followers","following_url":"https://api.github.com/users/rafaeleyng/following{/other_user}","gists_url":"https://api.github.com/users/rafaeleyng/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaeleyng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaeleyng/subscriptions","organizations_url":"https://api.github.com/users/rafaeleyng/orgs","repos_url":"https://api.github.com/users/rafaeleyng/repos","events_url":"https://api.github.com/users/rafaeleyng/events{/privacy}","received_events_url":"https://api.github.com/users/rafaeleyng/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-07-11T15:23:03Z","updated_at":"2016-07-12T03:22:30Z","closed_at":"2016-07-12T03:22:30Z","body":"**Description:**\r\n\r\n**The scenario**:\r\n\r\nI'm developing a \"virtual tour\" application with a-frame. The core of my app is basically a `<a-scene>` with `<a-assets>`, a single `<a-sky>` and some (1 to 3, depending the situation) `<a-image>` used for navigation purposes. On every navigation I just change the sky `src` attribute with the id of another asset.\r\n\r\nI'm using React to organize my scene in components: one for the scene itself (together with assets and camera), a child component for the room (with the sky and the nav elements) and a nav component.\r\n\r\nFor the assets, for each room, I put in `<a-assets>` the image for that particular room, and the image for all the possible rooms that can be reached from that one (to prefetch them). Since I'm using React to help me here, I keep an array of all the assets that were already put in `<a-assets>`, and I only add to it the ones that never were loaded. So I start with, say, 5 assets (nav images, current room sky, next room sky), and as I navigate, more assets are put in `<a-assets>`, but the ones that are already there are never touched. So, at the end of the tour, I might have about 15-20 assets in `<a-assets>`.\r\n\r\nI have around 15 different \"rooms\" (so 15 sky images). The sky images range from 500kb to 2mb. My nav images are always with the same src, and it is a small png image (less than 100KB).\r\n\r\nEach sky image is only being loaded once and not making any more requests (100% sure, checked on browser and on server), but my navigation image gets loaded once and then on every navigation it makes the request again, but with 304 status. Could not find a way to overcome this, but it shouldn't be a big problem.\r\n\r\nThe components are behaving well, so I'm not having several renderings of my react components for each transition or something like that.\r\n\r\n**The problem**:\r\n\r\nI have a major performance problem testing the app in my Android phone (Motorola Moto X, 2nd generation, 2GB of RAM) with Chrome. After around 10-20 transitions between rooms (in some rooms I don't have an option besides going back to the previous room), the transitions begin to get slower and slower, to the point where I focus to my nav element and my phone freezes, so I need to restart it. I tried Firefox on my phone but the Firefox will crash every time a few seconds after loading the app. Firefox even crashes with the oficial [hello world demo](https://aframe.io/examples/showcase/helloworld/), so I don't think that this is my problem exclusively.\r\n\r\nIn my computer (MacBook Air, 4GB of RAM, i5 CPU), I can run my app with much more stuff on it and everything runs fine. I've added [gifs](https://github.com/mayognaise/aframe-gif-shader) in my navigations, [text](https://github.com/ngokevin/aframe-text-component), audio (a different audio for each room) and [mouse-cursor](https://github.com/mayognaise/aframe-mouse-cursor-component) and I had no problem running my app. Although, when I navigate about 20 times between rooms, the RAM consumption gets bigger than 500MB with all this stuff, and 200MB-300MB without it (as simple as when I get the crash on mobile).\r\n\r\n\r\n**Conclusion**:\r\n\r\nIt would be really nice to receive some suggestions about what I might be doing wrong. I can show some code if my description is not enough and if you think that would be helpful, but I think my description was pretty complete.\r\n\r\n- A-Frame Version: 0.2.0\r\n- Platform/Device: critical on mobile (Chrome 51.0.2704.81, Firefox 47.0), bad in desktop (Chrome 51.0.2704.103)\r\n"}}
{"actor":{"display_login":"rafaeleyng"}}