waldnercharles/Minimis

Lagging on larger directories

Closed this issue · 5 comments

It appears that a lot is being pre-loaded and its taking quite some time to index at beginning. I have about 2000 entries within a directory and it is noticeably slower than when I had 300.

In comparison, if I goto default pegasus grid, the theme loads nearly instantly and the artbox is seen loading

What sort of device are you running on? If you're running on a lower powered device, that makes sense. This is because of a workaround I'm performing to get random games to work. When the theme starts up, I loop through all of the games and shuffle them around. If you don't care about the random games category, a workaround for now I think is to comment out or remove lines 156-160. https://github.com/waldnercharles/Minimis/blob/master/theme.qml#L156-L160

The way I'm doing it also isn't super fast. Math.random is quite slow. A better solution would be to write my own mersenne twister implementation, and then maybe only perform a shuffle on the first half of the array, swapping with games in the 2nd half.

commenting out lines 156-160 returns an error

2022-07-05T12:16:15 [w] file:///storage/emulated/0/pegasus-frontend/themes/Minimis-master/theme.qml:162:30: Expected token `:'

You might have gotten rid of one too many } or left in one too many }

I overwrote the entire folder with the one from git to start over, and commented out the lines. I did not want to sift through squigglies. That did the trick. There is a noticeable improvement in load time. It does still load a bit longer than other themes I've tested.

This should be fixed in the latest version.