After looking into the "New Music is stalling my system" issue (see http://forums.slimdevices.com/showthread.php?93854&p=753996&viewfull=1#post753996) I tried to understand why Browse Music Folder was causing headaches, too. Looking into it I came to realise there indeed is a major issues when hitting folders with many items in them.

A little background to better understand the trade-offs: our UIs work in pages. The web UI shouws (roughly) 50 items per page, Radio/Touch/Controller etc. would request junks of 200 items until they had the full list of items.

As BMF is not DB based, the current implementation would inspect every item in a folder until it had all the items needed to fulfill a request. While this is adequate for the first page, it becomes very expensive for subsequent pages: for the second page all of the first page's items would be processed, though not returned in the query. If you had a folder with 400 files/subfolders in it, LMS would actually process 600 items (200 of them twice). The number is roughly (n+1)/2*n*s items (where n is the number of pages, and s the number of items per page).

I've committed a change which should get rid of the repeated processing of items in "earlier" pages. This effectively allows me to browse Erland's flac1000 collection (7.6k folders in the main folder).

There is a downside to this change: while previously the first page full of items would be shown pretty quickly, it now takes longer, as the full list is pre-processed and cached before the first items are returned. But this should only have an impact on users with very large folders - which otoh will profit the most from the speedup on subsequent pages.

Please give BMF (and browsing by artist & new music) some thorough testing - thanks!

--

Michael
_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/beta

Reply via email to