Blow WindowPlugins.dll to separate plugin DLLs (1 Viewer)

Sebastiii

Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I just try latest GIT version from seco :)
    With all Native plugins from MP, all seems OK (Music / Video / TV etc.)
    It's nice :p
     

    msj33

    MP Donator
  • Premium Supporter
  • November 30, 2005
    471
    76
    Home Country
    England England
    Thumbs up on this: http://mantis.team-mediaportal.com/view.php?id=4080!

    Mediaportal startup is way too slow! - takes just as long to startup MePo, as the OS on SSD!

    Why not let Mediaportal instantly load the home as a single .dll -> Display the menu -> Load all other .dlls in background!

    Comparing against XBMC start........I won't even mention it!
     
    Last edited:

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,959
    1,270
    Saratov
    Home Country
    Russian Federation Russian Federation
    Why not let Mediaportal instantly load the home as a single .dll -> Display the menu -> Load all other .dlls in background!
    If MP is already opened and no plugin is started what can you do with empty MP?
    Better way is optimization. Maybe load each plugin in own separate thread (but this could lead to new bugs)
    Or maybe some plugins which has no background processes could be inited at the same time as calling OnPageLoad
     
    Last edited:

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    • Thread starter
    • Moderator
    • #24
    Let me clear up few things:

    1. Plugin loading: This thread is about making MP default plugins to single DLLs. This means that you can really get rid of the default plugins you don't need or use and the performance impact is clear for MP startup: fewer DLLs loaded will result faster startup.

    2. Plugin initializing: Whole other thing is how plugin developers tend to initialize their plugins. Basically everything that goes to plugin Init() method will slow down MP startup. If the developer does not understand this, then the plugin probably will result more delay to MP startup.

    3. Other stuff: There might be a lot of other optimization that can be done that has nothing to do with plugin loading & initializing.
     

    msj33

    MP Donator
  • Premium Supporter
  • November 30, 2005
    471
    76
    Home Country
    England England
    Why not let Mediaportal instantly load the home as a single .dll -> Display the menu -> Load all other .dlls in background!
    If MP is already opened and no plugin is started what can you do with empty MP?

    What I am trying to say - I wish for a better load behavior of plugins.

    Not only are some plugins "hardcoded" in windowplugins.dll, but all enabled .dll plugins are loaded before displaying the GUI.

    My idea about a more logic way to do this, is by "cheating" the user to think everything is loaded.
    1. User opens Mediaportal
    2. Load only skin(+dependencies) & Menu(with menu items for all enabled extensions/plugins - but do not load the plugins yet!).
    3. Plugin load behavior could then be by default, optional or set by plugin developer:
      1. Load ALL plugins in background by default - If user enters menu item before plugin is loaded=Show "loading circle"
      2. Let developer set load behaviour(Background/clicked)?
      3. Load plugins, when it's clicked (not optimal)
    I would rather display the GUI, than the actual "loading" screen - Yes, it works.........but its not pretty

    /Morten
     

    msj33

    MP Donator
  • Premium Supporter
  • November 30, 2005
    471
    76
    Home Country
    England England
    Let me clear up few things:

    1. Plugin loading: This thread is about making MP default plugins to single DLLs. This means that you can really get rid of the default plugins you don't need or use and the performance impact is clear for MP startup: fewer DLLs loaded will result faster startup.

    2. Plugin initializing: Whole other thing is how plugin developers tend to initialize their plugins. Basically everything that goes to plugin Init() method will slow down MP startup. If the developer does not understand this, then the plugin probably will result more delay to MP startup.

    3. Other stuff: There might be a lot of other optimization that can be done that has nothing to do with plugin loading & initializing.

    1. Great job - that will have some effect to startup time:)
    2. I do not know the technical side of the plugin initializing in Mepo - but do MePo actually have a feature to load a plugin in background - because then is does not seem to be used by developers - a basic skin+menu cannot take many seconds to load in 2012.
    3. Would be nice to identify it more specifically.......I still believe Mediaportal is a bit "heavy duty" on even new hardware.
    /Morten
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    • Thread starter
    • Moderator
    • #27
    1. Great job - that will have some effect to startup time:)
    2. I do not know the technical side of the plugin initializing in Mepo - but do MePo actually have a feature to load a plugin in background - because then is does not seem to be used by developers - a basic skin+menu cannot take many seconds to load in 2012.
    3. Would be nice to identify it more specifically.......I still believe Mediaportal is a bit "heavy duty" on even new hardware.
    /Morten

    2. Actually the background initialization you suggested would be very complex solution for a problem which usually can be solved on the plugin code side. I bet most of the plugins do no time-consuming processing during the initialization so the delay caused here is just milliseconds. And if they do that should be done in a separate thread.

    3. This is what Mantis issue was created for
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    1. Great job - that will have some effect to startup time:)
    2. I do not know the technical side of the plugin initializing in Mepo - but do MePo actually have a feature to load a plugin in background - because then is does not seem to be used by developers - a basic skin+menu cannot take many seconds to load in 2012.
    3. Would be nice to identify it more specifically.......I still believe Mediaportal is a bit "heavy duty" on even new hardware.
    /Morten


    2. Actually the background initialization you suggested would be very complex solution for a problem which usually can be solved on the plugin code side. I bet most of the plugins do no time-consuming processing during the initialization so the delay caused here is just milliseconds. And if they do that should be done in a separate thread.

    We probably should add some performance logging (if not already done) for the plugin init calls that MP is making. That way we could pin point the slow starup that is caused by specific plugins and then we could ask the 3rd party plugin (or even MP core :p) developers to fix the init code.
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    • Thread starter
    • Moderator
    • #29
    We probably should add some performance logging (if not already done) for the plugin init calls that MP is making. That way we could pin point the slow starup that is caused by specific plugins and then we could ask the 3rd party plugin (or even MP core :p) developers to fix the init code.

    This can already be roughly estimated by log lines like

    Code:
    Load plugins from : D:\Programs\MediaPortal\Plugins\windows\WindowPlugins.dll
    2012-12-06 20:00:20.901675 [Info.][MPMain(1)]:  File Version : 1.2.200.0

    What I find disturbing is that both MP Music and Video database are opened during initialization:

    Code:
    2012-12-06 20:00:20.895674 [Info.][MPMain(1)]:  LoadWindowPlugins()
    2012-12-06 20:00:20.897674 [Info.][MPMain(1)]:  Load plugins from : D:\Programs\MediaPortal\Plugins\windows\WindowPlugins.dll
    2012-12-06 20:00:20.901675 [Info.][MPMain(1)]:  File Version : 1.2.200.0
    2012-12-06 20:00:20.928676 [Info.][MPMain(1)]: MusicDatabase: Opening database
    2012-12-06 20:00:20.929676 [Info.][MPMain(1)]: using sqlite 3.7.11
    2012-12-06 20:00:20.930676 [Info.][MPMain(1)]: MusicDatabase: Database opened
    2012-12-06 20:00:20.951677 [Debug][MPMain(1)]: GUIMusicPlayingNow: Viz disabled - ShowViz False, VizName None
    2012-12-06 20:00:20.955678 [Info.][MPMain(1)]:  Loading references from C:\ProgramData\Team MediaPortal\MediaPortal\Skin\DefaultWide\references.xml
    2012-12-06 20:00:20.957678 [Info.][MPMain(1)]:  original skin size:1280x720
    2012-12-06 20:00:21.024682 [Debug][MPMain(1)]: Cacheing expression: #(iif(and(neq(L(102012), #currentmodule), neq(L(102002), #currentmodule), neq(L(100100), #currentmodule), neq(L(102015), #currentmodule)), #currentmodule, ' '))
    2012-12-06 20:00:21.030682 [Debug][MPMain(1)]: Cacheing expression: and(neq(L(102012), #currentmodule), neq(L(102002), #currentmodule), neq(L(100100), #currentmodule), neq(L(102015), #currentmodule))
    2012-12-06 20:00:21.030682 [Debug][MPMain(1)]: Cacheing expression: neq(L(102012), #currentmodule)
    2012-12-06 20:00:21.030682 [Debug][MPMain(1)]: Cacheing expression: L(102012)
    2012-12-06 20:00:21.030682 [Debug][MPMain(1)]: Cacheing expression: 102012
    2012-12-06 20:00:21.031682 [Debug][MPMain(1)]: Cacheing expression: #currentmodule
    2012-12-06 20:00:21.031682 [Debug][MPMain(1)]: Cacheing expression: neq(L(102002), #currentmodule)
    2012-12-06 20:00:21.031682 [Debug][MPMain(1)]: Cacheing expression: L(102002)
    2012-12-06 20:00:21.032682 [Debug][MPMain(1)]: Cacheing expression: 102002
    2012-12-06 20:00:21.032682 [Debug][MPMain(1)]: Cacheing expression: neq(L(100100), #currentmodule)
    2012-12-06 20:00:21.032682 [Debug][MPMain(1)]: Cacheing expression: L(100100)
    2012-12-06 20:00:21.032682 [Debug][MPMain(1)]: Cacheing expression: 100100
    2012-12-06 20:00:21.033682 [Debug][MPMain(1)]: Cacheing expression: neq(L(102015), #currentmodule)
    2012-12-06 20:00:21.033682 [Debug][MPMain(1)]: Cacheing expression: L(102015)
    2012-12-06 20:00:21.033682 [Debug][MPMain(1)]: Cacheing expression: 102015
    2012-12-06 20:00:21.033682 [Debug][MPMain(1)]: Cacheing expression: ' '
    2012-12-06 20:00:21.040683 [Debug][MPMain(1)]: Cacheing expression: #(L(180))
    2012-12-06 20:00:21.040683 [Debug][MPMain(1)]: Cacheing expression: 180
    2012-12-06 20:00:21.044683 [Debug][MPMain(1)]: Cacheing expression: #(L(171))
    2012-12-06 20:00:21.044683 [Debug][MPMain(1)]: Cacheing expression: 171
    2012-12-06 20:00:21.045683 [Debug][MPMain(1)]: Cacheing expression: #(L(179))
    2012-12-06 20:00:21.045683 [Debug][MPMain(1)]: Cacheing expression: 179
    2012-12-06 20:00:21.045683 [Debug][MPMain(1)]: Cacheing expression: #(L(170))
    2012-12-06 20:00:21.045683 [Debug][MPMain(1)]: Cacheing expression: 170
    2012-12-06 20:00:21.046683 [Debug][MPMain(1)]: Cacheing expression: #(L(435))
    2012-12-06 20:00:21.046683 [Debug][MPMain(1)]: Cacheing expression: 435
    2012-12-06 20:00:21.046683 [Debug][MPMain(1)]: Cacheing expression: #(L(436))
    2012-12-06 20:00:21.047683 [Debug][MPMain(1)]: Cacheing expression: 436
    2012-12-06 20:00:21.065684 [Warn.][MPMain(1)]: GUIWindow:OnWindowLoaded: 'C:\ProgramData\Team MediaPortal\MediaPortal\Skin\DefaultWide\MyMusicPlayingNow.xml' is missing control id 999 (window property: VUMeterLeft)
    2012-12-06 20:00:21.065684 [Warn.][MPMain(1)]: GUIWindow:OnWindowLoaded: 'C:\ProgramData\Team MediaPortal\MediaPortal\Skin\DefaultWide\MyMusicPlayingNow.xml' is missing control id 998 (window property: VUMeterRight)
    2012-12-06 20:00:21.068684 [Info.][MPMain(1)]: GUIMusicPlaylist: Loading default playlist default.m3u
    2012-12-06 20:00:21.081685 [Warn.][MPMain(1)]: GUIWindow:OnWindowLoaded: 'C:\ProgramData\Team MediaPortal\MediaPortal\Skin\DefaultWide\musicOverlay.xml' is missing control id 0 (window property: _videoRectangle)
    2012-12-06 20:00:21.082685 [Warn.][MPMain(1)]: GUIWindow:OnWindowLoaded: 'C:\ProgramData\Team MediaPortal\MediaPortal\Skin\DefaultWide\musicOverlay.xml' is missing control id 6 (window property: _labelBigPlayTime)
    2012-12-06 20:00:21.082685 [Warn.][MPMain(1)]: GUIWindow:OnWindowLoaded: 'C:\ProgramData\Team MediaPortal\MediaPortal\Skin\DefaultWide\musicOverlay.xml' is missing control id 9 (window property: _videoWindow)
    2012-12-06 20:00:21.095686 [Info.][MPMain(1)]: opening video database
    2012-12-06 20:00:21.105686 [Info.][MPMain(1)]: Cleaned up 0 rows for unwanted paths.
    2012-12-06 20:00:21.105686 [Info.][MPMain(1)]: Found 0 files without path link. Cleaning files related tables.
    2012-12-06 20:00:21.106686 [Info.][MPMain(1)]: Cleaned up 0 rows for tables without file link.
    2012-12-06 20:00:21.106686 [Info.][MPMain(1)]: Clean up files (no path link): 0 rows affected.
    2012-12-06 20:00:21.106686 [Info.][MPMain(1)]: Clean up path (no file link): 0 rows affected.
    2012-12-06 20:00:21.107686 [Info.][MPMain(1)]: Clean up movie (no path link): 0 rows affected.
    2012-12-06 20:00:21.107686 [Info.][MPMain(1)]: Clean up actorinfo (no actorId link to actors): 0 rows affected.
    2012-12-06 20:00:21.107686 [Info.][MPMain(1)]: Clean up actorlinkmovie (no actorId link to actors): 0 rows affected.
    2012-12-06 20:00:21.107686 [Info.][MPMain(1)]: Clean up actorlinkmovie (no movie link): 0 rows affected.
    2012-12-06 20:00:21.108686 [Info.][MPMain(1)]: Clean up actorinfomovies (no actorId link to actors): 0 rows affected.
    2012-12-06 20:00:21.108686 [Info.][MPMain(1)]: Clean up movieinfo (no movie link): 0 rows affected.
    2012-12-06 20:00:21.108686 [Info.][MPMain(1)]: Clean up genrelinkmovie (no movie link): 0 rows affected.
    2012-12-06 20:00:21.108686 [Info.][MPMain(1)]: Compacting videodatabase: 401408 bytes
    2012-12-06 20:00:21.114687 [Info.][MPMain(1)]: Compacting finished successfully. New file lenght: 401408 bytes
    2012-12-06 20:00:21.118687 [Info.][MPMain(1)]: video database opened

    I really can't say what kind of effect this has with large music and video databases, I'm running clean & empty setup so the delay is minimal.
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    Videodatabase 40MB < 1sec, but this cleanup thing will be removed for final (leftover from alpha for debug -> upgrade from 1.2.x, values should be corrected only once, later should be all 0)
     

    Users who are viewing this thread

    Top Bottom