Kodi Community Forum

Full Version: Frodo slow on reading/displaying large Directories
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

i got my movies (960 of them, each in a seperate direcotry) in one directory on a fileserver connected through nfs.
After upgrading to frodo it takes about 8 seconds (every time) to switch into that directory (xbmc gui freezes in that 8 seconds) . On eden it was nearly instant. So why is it taking so long ?!

Here the output from debug log:
23:57:32 T:3007784768 DEBUG: OnKey: 11 (0b) pressed, action is Select
23:57:32 T:3007784768 DEBUG: CGUIMediaWindow::GetDirectory (nfs://10.95.5.1/mnt/storage/movies/archive/)
23:57:32 T:3007784768 DEBUG: ParentPath = [nfs://10.95.5.1/mnt/storage/movies/]
23:57:40 T:3007784768 DEBUG: RunQuery took 74 ms for 963 items query: select * from movieview WHERE c23=1
23:57:40 T:3007784768 DEBUG: RunQuery took 0 ms for 2 items query: SELECT files.strFilename, files.playCount, bookmark.timeInSeconds, bookmark.totalTimeInSeconds FROM files LEFT JOIN bookmark ON files.idFile = bookmark.idFile AND bookmark.type = 1 WHERE files.idPath=1

OR

01:58:20 T:3007186752 DEBUG: CGUIMediaWindow::GetDirectory (nfs://10.95.5.1/mnt/storage/movies/archive/)
01:58:20 T:3007186752 DEBUG: ParentPath = [nfs://10.95.5.1/mnt/storage/movies/archive/]
01:58:20 T:3007186752 DEBUG: Loading fileitems [nfs://10.95.5.1/mnt/storage/movies/archive/]
01:58:20 T:3007186752 DEBUG: -- items: 966, directory: nfs://10.95.5.1/mnt/storage/movies/archive/ sort method: 0, ascending: false
01:58:27 T:3007186752 DEBUG: RunQuery took 70 ms for 963 items query: select * from movieview WHERE c23=1


SPECS:
Fileserver: Quadcore 3GHz
Network: Gigabit
XBMC: atom D525, 4gb ram, ssd
VideoDB on Fileserver(mySql)
full debug logs needed (pasted to a paste site)
Here is the full log:

http://paste.ubuntu.com/1616575/

you will see the time difference between line 489 and 490 which is about 7 seconds.

This "freeze" or whatever also happens with samba-shares.
After a little debugging i got this.

The freeze happens in windows/GUIMediaWindow::Update()
m_vecItems->FillInDefaultIcons(); is a huge slowdown
and
OnFilterItems(titleFilter) is the second slowdown.

maybe this can be optimized in a future release
I'm wondering if our issues are related. Here is my thread: http://forum.xbmc.org/showthread.php?tid=155178.

I see you are also using MySQL on what I assume is a remote machine. If you have a chance to test, can you try the same thing I did and see if it makes any difference? Remove the MySQL settings from advancedsettings (backing it up first of course) so that XBMC defaults back to a local SQLLite DB. You will have to reimport your movies from the NFS share once you do that. When I switched from MySQL back to SQLLite my speed issue was fixed, though I have no idea why.
For debuging purpose I didn't set up any database and the freezing is still happening.
And from what I figured out in the code, the database interaction is happening after the directory listing, filtering and stuff.
Maybe if the "replace filenames with database entries" options is selected it might have a direct impact.

for explanation here is my measurment
CGUIMediaWindow::GetDirectory (nfs://10.95.5.1/mnt/storage/movies/archive/)
ParentPath = [nfs://10.95.5.1/mnt/storage/movies/]
NFS Raw Directory Read in ms:347
Directory Read in ms:788
GUIMediaWindow::GetDirectory in ms:791
GUIWindowVideoBase::GetDirectory in ms:794
GUIWindowVideoNav::GetDirectory in ms:874
GUIMediaWindow::Update|GetDirecotry in ms:875
GUIMediaWindow::Update|ClearFileItems() in ms:1401
GUIMediaWindow::Update|OnPrepareFileItems() in ms:1410
GUIMediaWindow::Update|FillInDefaultIcons() in ms:5771
GUIMediaWindow::Update|GetProperty(filter).asString() in ms:5789
Thread Background Loader start, auto delete: false
GUIMediaWindow::Update|OnFilterItems(titleFilter) in ms:7747
GUIMediaWindow::Update() in ms:7868

As you see there are 4,3 seconds lost in FillInDefaultIcons() and 2 seconds OnFilterItems() and nothing of this is database related Smile