I noticed significant stuttering on my system when scrolling on my game lists. I put the debugger on it, and found that it was spending most of it's time in VideoGameListView::updateInfoPanel() which makes sense as this is doing file access to the video, marquee, and images to be displayed... but what I found odd was that it was called 3 times for the same game (performing file accesses each time!) and when I only scrolled by 1 (which seems rather unnecessary). It was called once by the input for the up or down button, then it was called twice again for by the stop scrolling.
It calls from the up or down button from here:
Which then calls
listInput(delta) then calls
scroll(), when then calls
onCursorChanged() which then calls the
updateInfoPanel() later on.
The stop scrolling is from here:
This function is even more strange to me... It calls
listInput(0) which will call the
onCursorChanged() function calling
updateInfoPanel(), but then it performs a direct call to
onCursorChanged() right after finishing
listInput(0).
VideoGameListView::updateInfoPanel()
|
void VideoGameListView::updateInfoPanel() |
I tried to think to myself.. "How can I fix this?", but as I was reading through the lower portions of the code, but more I just began to see spaghetti 🍝 (or I just need to spend more time understanding it) and wasn't quite sure how to re-architect it in order to fix these redundant files calls without breaking anything else as I believe this code is used with more than just Game Lists.
Anyways, I'm raising this issue just so it gets visibility from those who may have insights
I noticed significant stuttering on my system when scrolling on my game lists. I put the debugger on it, and found that it was spending most of it's time in
VideoGameListView::updateInfoPanel()which makes sense as this is doing file access to the video, marquee, and images to be displayed... but what I found odd was that it was called 3 times for the same game (performing file accesses each time!) and when I only scrolled by 1 (which seems rather unnecessary). It was called once by the input for theupordownbutton, then it was called twice again for by the stop scrolling.It calls from the
upordownbutton from here:EmulationStation/es-app/src/components/TextListComponent.h
Line 283 in c6bbd38
Which then calls
listInput(delta)then callsscroll(), when then callsonCursorChanged()which then calls theupdateInfoPanel()later on.The stop scrolling is from here:
EmulationStation/es-app/src/components/TextListComponent.h
Line 313 in c6bbd38
This function is even more strange to me... It calls
listInput(0)which will call theonCursorChanged()function callingupdateInfoPanel(), but then it performs a direct call toonCursorChanged()right after finishinglistInput(0).VideoGameListView::updateInfoPanel()
EmulationStation/es-app/src/views/gamelist/VideoGameListView.cpp
Line 247 in c6bbd38
I tried to think to myself.. "How can I fix this?", but as I was reading through the lower portions of the code, but more I just began to see spaghetti 🍝 (or I just need to spend more time understanding it) and wasn't quite sure how to re-architect it in order to fix these redundant files calls without breaking anything else as I believe this code is used with more than just Game Lists.
Anyways, I'm raising this issue just so it gets visibility from those who may have insights