{"action":"created","issue":{"url":"https://api.github.com/repos/DragonBones/DragonBonesAS/issues/45","repository_url":"https://api.github.com/repos/DragonBones/DragonBonesAS","labels_url":"https://api.github.com/repos/DragonBones/DragonBonesAS/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/DragonBones/DragonBonesAS/issues/45/comments","events_url":"https://api.github.com/repos/DragonBones/DragonBonesAS/issues/45/events","html_url":"https://github.com/DragonBones/DragonBonesAS/issues/45","id":39256186,"number":45,"title":"Code supporting \"fade\" functionality incurs significant performance burden even when fadeTime = 0","user":{"login":"kpatelPro","id":3334689,"avatar_url":"https://avatars.githubusercontent.com/u/3334689?v=3","gravatar_id":"","url":"https://api.github.com/users/kpatelPro","html_url":"https://github.com/kpatelPro","followers_url":"https://api.github.com/users/kpatelPro/followers","following_url":"https://api.github.com/users/kpatelPro/following{/other_user}","gists_url":"https://api.github.com/users/kpatelPro/gists{/gist_id}","starred_url":"https://api.github.com/users/kpatelPro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpatelPro/subscriptions","organizations_url":"https://api.github.com/users/kpatelPro/orgs","repos_url":"https://api.github.com/users/kpatelPro/repos","events_url":"https://api.github.com/users/kpatelPro/events{/privacy}","received_events_url":"https://api.github.com/users/kpatelPro/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2014-08-01T02:13:08Z","updated_at":"2016-07-22T03:20:48Z","closed_at":"2016-07-22T03:20:48Z","body":"I was running a performance comparison between DragonBonesAS and flump by converting the same flash animation to both systems and running the Adobe Scout over a test harness running 100 instances of the animation, once with DragonBonesAS and once with flump.\r\n\r\nflump was outperforming DragonBonesAS, so I took a deeper look into the data and found that the reason is that DragonBones incurs a large cost by always \"fading out\" AnimationStates to remove them, even if the fadeTime is 0.\r\n\r\nAs a test, I wrote a wrapper that simply directly called Animation.removeState whenever the fadeTime to fadeOut is 0, as well as a minor shortcut for fadeIn, again when the fadeTime is 0.  The result was an improvement in performance of 15% with my test object and an improved and more stable garbage collection profile.\r\n\r\n***\r\nData description:  My DragonBones animation includes nested armatures, and including one instance of a \"flipbook\" like layer which switches between different images.\r\n***\r\n\r\nI am happy to prepare a pull request with a clean implementation of this optimization, but I have a question to ask before doing so:  Is it desirable that AnimationEvent.FADE_IN_COMPLETE and AnimationEvent.FADE_OUT_COMPLETE fire when there is in fact no fading (fadeTime = 0)?  It is my opinion that this is undesirable.  That said, changing this would represent a change from the current behavior, so I am happy keep it or change it as you prefer.\r\n\r\nLooking forward to your reply.\r\nKen\r\n"},"comment":{"url":"https://api.github.com/repos/DragonBones/DragonBonesAS/issues/comments/234445272","html_url":"https://github.com/DragonBones/DragonBonesAS/issues/45#issuecomment-234445272","issue_url":"https://api.github.com/repos/DragonBones/DragonBonesAS/issues/45","id":234445272,"user":{"login":"akdcl","id":1896946,"avatar_url":"https://avatars.githubusercontent.com/u/1896946?v=3","gravatar_id":"","url":"https://api.github.com/users/akdcl","html_url":"https://github.com/akdcl","followers_url":"https://api.github.com/users/akdcl/followers","following_url":"https://api.github.com/users/akdcl/following{/other_user}","gists_url":"https://api.github.com/users/akdcl/gists{/gist_id}","starred_url":"https://api.github.com/users/akdcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akdcl/subscriptions","organizations_url":"https://api.github.com/users/akdcl/orgs","repos_url":"https://api.github.com/users/akdcl/repos","events_url":"https://api.github.com/users/akdcl/events{/privacy}","received_events_url":"https://api.github.com/users/akdcl/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T03:20:48Z","updated_at":"2016-07-22T03:20:48Z","body":"Sorry for the late reply, now you can use armature.cacheFrameRate to cache animation, it will get a great improvement in performance."}}
{"actor":{"display_login":"akdcl"}}