Open hinto-janai opened 11 months ago
Festival GUI v1.3.0
The Songs tab is very laggy.
Songs
Although the current code only displays the viewport (good), every single Song object is iterated through and processed (very bad).
Song
Selectively index through the songs (e.g [start..end]) and only process and display those.
[start..end]
The issue is when a scrollbar is involved - "where" we are in the array must be accounted for depending on how far the scrollbar has scrolled.
The range (e.g 10 songs listed? 20 songs?) depends on sizing, resolution, etc - although this should be easy to find:
let total_rows = ui.height() / desired_row_height; for song in songs[start..start + total_rows] { /* process and display songs */ }
Different sort orderings may change things as well.
Version
Festival GUI v1.3.0
Bug
The
Songs
tab is very laggy.Although the current code only displays the viewport (good), every single
Song
object is iterated through and processed (very bad).Fix
Selectively index through the songs (e.g
[start..end]
) and only process and display those.The issue is when a scrollbar is involved - "where" we are in the array must be accounted for depending on how far the scrollbar has scrolled.
The range (e.g 10 songs listed? 20 songs?) depends on sizing, resolution, etc - although this should be easy to find:
Different sort orderings may change things as well.