Sign up here and you can log into the forum!

Plugins collection speed up

General WDTVExt forum

Plugins collection speed up   

Postby sailort » Sat May 22, 2010 1:38 pm

Hi pibos,

been playing with /apps/WDTVExt/js/plugin.js a liitle bit and here is code which greatly improves plugin search process:

Code: Select all
Plugin.collectPlugins = function(path) {
   traceln("searching plugins in " + path);
   var pfile = new File("| /usr/bin/find " + path + " -iname *.plugin.js");
   pfile.open();
   var pplugins=pfile.readAll();
   pfile.close();
   delete pf;
   if(pplugins) {
      for (var inx=0;inx<pplugins.length;inx++) {
         traceln("Plugin found: " + pplugins[inx]);
         Plugin.pluginsPath.push(pplugins[inx]);
      }
   }
}


differencies in collect times:

original
Code: Select all
End collecting plugins... took 120087ms


with code above
Code: Select all
End collecting plugins... took 610ms


If there is a marketing department they would say something like "200x faster" :D

If this has been already resolved I appologize for spam.

Regards
T.
Last edited by sailort on Mon Jun 21, 2010 9:55 am, edited 1 time in total.
If you like my work and want to buy me a bottle of wine, you can do it this way. Thanks for your support.
sailort
Developer
 
Posts: 363
Joined: Sat Apr 24, 2010 6:42 am

Re: Plugins collection speed up   

Postby recliq » Sat May 22, 2010 2:56 pm

quite neat hack, thx
although my plugin collect was already pretty fast (~300ms), it's now still 3 times faster (~100ms) :D
Code: Select all
detected 4 plugins
End collecting plugins... took 101ms
­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: 5035
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Plugins collection speed up   

Postby Buhric » Mon Jun 21, 2010 9:52 am

How and where can i modify my plugin.js so that it runs faster...
right now for 4 plugins it takes about 50 seconds!!!
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: Plugins collection speed up   

Postby sailort » Mon Jun 21, 2010 9:54 am

Buhric wrote:How and where can i modify my plugin.js so that it runs faster...

/apps/WDTVExt/js/plugin.js
If you like my work and want to buy me a bottle of wine, you can do it this way. Thanks for your support.
sailort
Developer
 
Posts: 363
Joined: Sat Apr 24, 2010 6:42 am

Re: Plugins collection speed up   

Postby Buhric » Mon Jun 21, 2010 12:48 pm

Well I can't seam to do it.... I have the EXT3 version for B-Rad's firmware v0.4.2.0
But it says that I dont' have write access in that folder...
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: Plugins collection speed up   

Postby recliq » Tue Jun 22, 2010 10:04 pm

That's because WDTVExt.app.bin is a ROMFS image, thus it's ReadOnly.
You would have to create an ext2/3 image file and copy the contents of WDTVExt.app.bin to the new image.
The new final app.bin file MUST have the same name: WDTVExt.app.bin :geek:
­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: 5035
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Plugins collection speed up   

Postby Buhric » Tue Jun 22, 2010 10:08 pm

Thanks, I found it out. and its working...
Wow major difference from 50+sec to less than 1
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: Plugins collection speed up   

Postby Eugen1968 » Wed Jun 23, 2010 1:35 pm

Thanks, I found it out. and its working...
Wow major difference from 50+sec to less than 1

Buhric post the modified WDTVExt.app.bin. Thanks
Eugen1968
Donor
 
Posts: 40
Joined: Sun Apr 11, 2010 6:34 am

Re: Plugins collection speed up   

Postby Buhric » Wed Jun 23, 2010 2:44 pm

Ok, heres the modified file
http://www.mediafire.com/?ujdjkizjoyd

Please take not that the ONLY thing I did was edit the original /js/plugin.js file
I commented the Original "Plugin.collectPlugins" function
and pasted in Sailort's "Plugin.collectPlugins" function then recreated the app.bin as an EXT3 file system

All credit goes to:
pibos for creating the plugin in the 1st place
sailort for his updated and faster plugin collection
recliq for pointing me in the right direction
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: Plugins collection speed up   

Postby recliq » Wed Jun 23, 2010 3:56 pm

btw: i added this patch to svn version as well.
Last edited by recliq on Sun Jul 04, 2010 12:53 am, edited 1 time in total.
­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: 5035
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Next

Return to WDTVExt discussion

Who is online

Users browsing this forum: No registered users and 2 guests