by drakinite » Sat Jun 27, 2020 10:32 pm
Dang, MM5 uses a lot of CPU for the listview. I did a performance analysis and it looks like the majority of time is being spent searching for track data (I see a ton of calls named bindData and getClassName that take a majority of scripting time), as well as multiple draw calls from ListView.parentScrollFrame per frame. Now, I've never developed any apps this complex, but my best guess for how to improve this would be to cache the track data so less time is spent retrieving it.
I always see isYoutubeTrack taking about half a millisecond because it runs a JSON.parse for every track for every frame, as well as a few other getValue calls that do extra processing that takes time. Also, the ListView header's vertical position is modified outside an animationFrame, which wastes 3ms of render time each frame.
Honestly, poking through all these callbacks was amazing, because I was originally expecting to see a few obvious bottlenecks that would be easily fixable; not a ton of complex code that all adds up in the long run. ^^; Anyways, I do think that the high cpu usage is an issue, and if it's possible to improve, it would be great. Having inexplicable surges of CPU usage is pretty bad, especially for folks with low end computers. Hell, even just mousing around the listview still brings my cpu up to 15-20%.
Dang, MM5 uses a lot of CPU for the listview. I did a performance analysis and it looks like the majority of time is being spent searching for track data (I see a ton of calls named bindData and getClassName that take a majority of scripting time), as well as multiple draw calls from ListView.parentScrollFrame per frame. Now, I've never developed any apps this complex, but my best guess for how to improve this would be to cache the track data so less time is spent retrieving it.
I always see isYoutubeTrack taking about half a millisecond because it runs a JSON.parse for every track for every frame, as well as a few other getValue calls that do extra processing that takes time. Also, the ListView header's vertical position is modified outside an animationFrame, which wastes 3ms of render time each frame.
Honestly, poking through all these callbacks was amazing, because I was originally expecting to see a few obvious bottlenecks that would be easily fixable; not a ton of complex code that all adds up in the long run. ^^; Anyways, I do think that the high cpu usage is an issue, and if it's possible to improve, it would be great. Having inexplicable surges of CPU usage is pretty bad, especially for folks with low end computers. Hell, even just mousing around the listview still brings my cpu up to 15-20%.