Sign up here and you can log into the forum!

Plugins collection speed up

General WDTVExt forum

Re: Plugins collection speed up   

Postby gendouhydeist » Sun Jul 04, 2010 12:27 am

@buhric
I've tried your modified wdext.app.bin but my wdtvlive doesn't boot up
gendouhydeist
n00b
 
Posts: 8
Joined: Sat Jun 05, 2010 6:33 pm

Re: Plugins collection speed up   

Postby Buhric » Sun Jul 04, 2010 4:39 am

I have it running on Firmware v0.4.1.9-6 EXT3 version... I did not test it on other versions...
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: Plugins collection speed up   

Postby Eugen1968 » Sun Jul 04, 2010 10:23 am

I have it running on 1.02.21_B-RAD.CC_WDLXTV_LIVE-0.4.2.0 and it's working well.
Eugen1968
Donor
 
Posts: 40
Joined: Sun Apr 11, 2010 6:34 am

Re: Plugins collection speed up   

Postby monkmad » Sun Jul 11, 2010 2:50 am

As discussed elsewhere, if the usb drive with your plugins folder has a lot of other files (in my case >1000, with lots of deep folder hierarchies), then the plugins collection function can still take a long time, as the "find" command searches through the whole drive to look for plugins.

If you have all your plugins neatly arranged in one folder at the root of the usb drive, you can modify the patch discussed above even further, to restrict the "find" command to a certain depth.

Basically, the following line in Plugin.collectPlugins
Code: Select all
var pfile = new File("| /usr/bin/find " + path + " -iname *.plugin.js");

becomes
Code: Select all
var pfile = new File("| /usr/bin/find " + path + " -maxdepth 4 -iname *.plugin.js");


This (in my case) looks only in the plugins folder at root and one additional level (e.g. /plugins/MovieSheets). Helped speed up the collection from 2.5 minutes to <10 seconds. You can experiment with the number passed to maxdepth to suit your folder hierarchy.

I'm not sure if there are others in the same situation; if anyone is interested, I can post a patched WDTVExt.app.bin

All the credit goes to pibos, sailort, recliq and buhric; I just tweaked their work by a tiny amount.
monkmad
Beta Tester
 
Posts: 96
Joined: Tue Apr 20, 2010 11:31 pm

Re: Plugins collection speed up   

Postby Eugen1968 » Wed Jul 14, 2010 9:23 am

I'm not sure if there are others in the same situation; if anyone is interested, I can post a patched WDTVExt.app.bin

@monkmad, post patched WDTVExt.app.bin, I won't try.
Last edited by Eugen1968 on Wed Jul 14, 2010 11:43 am, edited 1 time in total.
Eugen1968
Donor
 
Posts: 40
Joined: Sun Apr 11, 2010 6:34 am

Re: Plugins collection speed up   

Postby monkmad » Wed Jul 14, 2010 10:25 am

Eugen1968 wrote:@monkmad, post patched WDTVExt.app.bin, I wont try.


Not sure if you meant won't try to patch or won't try the file at all. :)

Here is the link WDTVExt.app.bin-plugin-collection-speedup.zip
monkmad
Beta Tester
 
Posts: 96
Joined: Tue Apr 20, 2010 11:31 pm

Re: Plugins collection speed up   

Postby Darren » Wed Jul 14, 2010 3:26 pm

Here's my own tweaked version of collectPlugins. I posted this in another thread, but I guess it should go here...

Based on the original function, I stayed with a native javascript method for collecting the plugins, as compared to piping a system call.

This native method takes under 150ms to collect the plugins, no matter how many files you have on your disks. It looks like the piped method is taking much longer than this if you have lots of files, even if you use the maxdepth option.

Code: Select all
Plugin.collectPlugins = function(path, level) {
   if(!level) var level=0;
   var c = new File(path);
   var l;
   if(level==1) l = c.list(/\.plugin\.js$|^plugins$/i);
   else l = c.list();
   for (var idx=0; idx<l.length; idx++) {
      if (l[idx].isDirectory) {
         if(level<3) Plugin.collectPlugins(l[idx].path, level+1)
      }
      else if (l[idx].isFile && l[idx].name.endsWith(".plugin.js")) {
         Plugin.pluginsPath.push(l[idx].path)
      }
   }
}
Darren
DLX'er
 
Posts: 69
Joined: Sat Jun 19, 2010 3:35 pm

Re: Plugins collection speed up   

Postby recliq » Fri Jul 16, 2010 7:43 am

can this handle links and dereference them? ;)
if not, it's not of much use as you will see with the next wdlxtv release...
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5021
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Plugins collection speed up   

Postby Darren » Fri Jul 16, 2010 10:49 am

Well, I can't plan for what I don't know about... :-)

Is there a post that details what's coming up?

And as far as dereferencing links, I suppose any script could do that, assuming a standard symlink is what you're talking about. But for ntfs/fat drives, I guess using links like that would be some strange hybrid?
Darren
DLX'er
 
Posts: 69
Joined: Sat Jun 19, 2010 3:35 pm

Re: Plugins collection speed up   

Postby b-rad.cc » Fri Jul 16, 2010 11:09 am

PM's are for private matters only, please post public matters on the forum to help others who might have the same issue.
:mrgreen:
User avatar
b-rad.cc
WDLXTV Team
 
Posts: 3002
Joined: Sat Apr 03, 2010 9:35 am
Location: New York

PreviousNext

Return to WDTVExt discussion

Who is online

Users browsing this forum: No registered users and 2 guests