{"action":"created","issue":{"url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/700","labels_url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/700/labels{/name}","comments_url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/700/comments","events_url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/700/events","html_url":"https://github.com/Gamua/Starling-Framework/issues/700","id":66123540,"number":700,"title":"Optimize setChildIndex for less objects creation","user":{"login":"Fraggle","id":24419,"avatar_url":"https://avatars.githubusercontent.com/u/24419?v=3","gravatar_id":"","url":"https://api.github.com/users/Fraggle","html_url":"https://github.com/Fraggle","followers_url":"https://api.github.com/users/Fraggle/followers","following_url":"https://api.github.com/users/Fraggle/following{/other_user}","gists_url":"https://api.github.com/users/Fraggle/gists{/gist_id}","starred_url":"https://api.github.com/users/Fraggle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fraggle/subscriptions","organizations_url":"https://api.github.com/users/Fraggle/orgs","repos_url":"https://api.github.com/users/Fraggle/repos","events_url":"https://api.github.com/users/Fraggle/events{/privacy}","received_events_url":"https://api.github.com/users/Fraggle/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Gamua/Starling-Framework/labels/Feature","name":"Feature","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-04-03T10:38:36Z","updated_at":"2015-04-13T12:16:23Z","closed_at":null,"body":"Hello,\r\n\r\nI noticed a lot of array beeing created by setChildIndex use of splice (especially from GAF).\r\nFrom my personal tests, avoiding the 2 splices calls with this:\r\n```\r\nvar offset:int = 0;\r\nvar size:int = mChildren.length;\r\nsSortBuffer.length = size;\r\nfor (var i:int=0; i < size; ++i) {\r\n if ( i == oldIndex )  {\r\n  ++offset;\r\n  sSortBuffer[i] = mChildren[i + offset];\r\n } else if ( i == index ) {\r\n  --offset;\r\n  sSortBuffer[i] = child;\r\n } else {\r\n  sSortBuffer[i] = mChildren[i + offset];\r\n }\r\n}\r\nsSortBuffer.length = 0;\r\n```\r\nHelped my framerate increase and memory decrease."},"comment":{"url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/comments/92331800","html_url":"https://github.com/Gamua/Starling-Framework/issues/700#issuecomment-92331800","issue_url":"https://api.github.com/repos/Gamua/Starling-Framework/issues/700","id":92331800,"user":{"login":"Oldes","id":454805,"avatar_url":"https://avatars.githubusercontent.com/u/454805?v=3","gravatar_id":"","url":"https://api.github.com/users/Oldes","html_url":"https://github.com/Oldes","followers_url":"https://api.github.com/users/Oldes/followers","following_url":"https://api.github.com/users/Oldes/following{/other_user}","gists_url":"https://api.github.com/users/Oldes/gists{/gist_id}","starred_url":"https://api.github.com/users/Oldes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Oldes/subscriptions","organizations_url":"https://api.github.com/users/Oldes/orgs","repos_url":"https://api.github.com/users/Oldes/repos","events_url":"https://api.github.com/users/Oldes/events{/privacy}","received_events_url":"https://api.github.com/users/Oldes/received_events","type":"User","site_admin":false},"created_at":"2015-04-13T12:16:23Z","updated_at":"2015-04-13T12:16:23Z","body":"I cannot understand how Vector can be slower than Array, because Vector is in theory just a raw block of memory with header describing a type and pointers (or direct values)."}}