[Scummvm-devel] ATTN Porters: SaveFileManager API Adjustments

Marcus Comstedt marcus at mc.pp.se
Mon Mar 21 19:41:17 CET 2016


Johannes Schickel <lordhoto at gmail.com> writes:

> Why is reading data from the block a operation taking time T
> (i.e. time to list save files + loading a small save in your scheme)?
> As I outlined, the way I see it is it takes (N+1)T+ND or (2N+1)T+ND,
> where T is the time to list save files and D is the time it takes to
> extract the description. I don't really see that T and D can be used
> interchangably, nor what their relation is in general.

I'm approximating T == D because they both amount to reading a couple
of blocks from the memory card, so they will be of the same order of
magnitude.


> Are stale entries the only issue we talk about which prevent you from
> caching available files inside your SaveFileManager implementation?

It's the main reason why caching in the backend can't work the way the
API looks right now.  ("Stale entries" might not be the best
description, since false negatives is also a problem.)

Another problem is that if the cache is never purged the memory
it uses will never be reclaimed.  Probably not a huge issue, but
memory is tight already.  Note that in order to be able to handle all
possibe calls, _all_ filenames would need to be cached, not just those
which match the glob provided to listSavegames.  The backend can't
predict which filenames the engine will ask for in the future, only
the engine can do that.


  // Marcus






More information about the Scummvm-devel mailing list