[Scummvm-devel] R: Re: Dynamic Plugins (uncached) - optimization

sunmax at libero.it sunmax at libero.it
Sat Jan 25 20:18:12 CET 2014

Hi Johannes,

no need to load them all.

As we know a-priori that "comi", "dig", "mokey2", etc. all maps to "scumm.plg"

So if the folder start with "comi*", "dig*", "monkey2*" etc. we try to load 
scumm.plg first.

It's a 99% chances a match, unless someone with a twisted mind, store Broken 
Sword 2 in a folder called "comi" ;-)

So we just need a table to match them, and to enjoy the very best performance 
out of dynamic plugins.

Of course if the "optimized match" fails, the logic will continue as it is now 
to try the other plugins.

Cached is very slow to start on some embedded devices. And then if you decide 
to add more games after you play one, still have to go through the same drill 
and 3-5 minutes of patience for each addition.

While the match table and folder name optimization will take this few minutes 
down to few seconds on embedded devices.


>----Messaggio originale----
>Da: lordhoto at gmail.com
>Data: 25/01/2014 19.22
>A: <scummvm-devel at lists.sourceforge.net>
>Ogg: Re: [Scummvm-devel] Dynamic Plugins (uncached) - optimization
>On 01/25/2014 07:10 PM, sunmax at libero.it wrote:
>> Hi there Team,
>> we are still forced to release a "static" (with the plugins linked in) 
>> at least on PS2, since detecting & adding new games with an uncached 
>> plugins setup is painstakingly slow... It takes 2-3 minutes we bad luck, 
>> you can go for an expresso coffee every time you add a new games ;-)
>> Uncached is the best setup, as it boots much faster and doesn't load all 
>> plugins at start (which spoils the benefit of saving memory), so I thought 
of a
>> possible small change which will givee us the best of all worlds: fast 
>> low memory usage, fast add of new games.
>> I noticed that most of the times I name the directory containing the games,
>> with the actual "gameid" (as per scummvm.ini), e.g. I have "The Dig" in 
>> "Broken Sword 2" in "sword2", and so on.
>> If I have multiple versions, I append the extra portion at the end, e.g.
>> "monkey2-amiga".
>> For all these cases, we can use a simple optimization, which will really 
>> a difference:
>> "if the folder name we are adding a game from, starts with a gameid, try 
>> matching engine plugin first"
>But to know which plugin supports which gameid we would still need to 
>load all plugins? I don't really see how that would be faster than using 
>cached plugin mode in the first place (note that even for cached plugin 
>mode it will unload all except the one it actually needs when running a 
>game, so memory usage is only higher in the launcher/detection compared 
>to uncached).
>// Johannes

>CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>Learn Why More Businesses Are Choosing CenturyLink Cloud For
>Critical Workloads, Development Environments & Everything In Between.
>Get a Quote or Start a Free Trial Today. 
>Scummvm-devel mailing list
>Scummvm-devel at lists.sourceforge.net

More information about the Scummvm-devel mailing list