[Scummvm-devel] File handling revamp

Max Horn max at quendi.de
Tue Jul 29 20:33:44 CEST 2008


Hi again Lars, all,


Am Di, 29.07.2008, 16:09, schrieb Max Horn:
>
> Am 29.07.2008 um 11:54 schrieb Lars Persson:
>
>> Hi!
>> This sounds execellt!
>> What I discovered when looking at the file performance issues for
>> Symbian is that due to alignment stuff, even an 16 bit read from an
>> engine boils down to two byte reads.
>>
>> So having a generic cache function would really be benefitial, since
>> that is what I'm doing in the Symbian file backend right now, and
>> that has only taken a couple of days to implement.
>>
>> Of course this will depend on what you want to achieve with the
>> generic buffering, but I think thats better than relying on
>> underlaying system calls which might or not be available.
>

[... ]
> One approach would be to provide a BufferedReadStream class (and also
> a BufferedSeekableReadStream class) which could then wrap around any
> (Seekable)ReadStream [...]
[...]
>
> Now, that's just a quick idea I had, I didn't spend too much thinking
> about it. If people see a better way or see flaws in this approach
> (besides the slight overhead incurred by it, but I would hope that it
> is not worse than we have already), please state so!

Since I liked the idea all in all, I just sat down and implemented a
proof-of-concept version (including a simple unit test, but not tested
otherwise). If we decide it's a crap approach, it'll be easy enough to
revert it again. OTOH, actual code often says more than many words, so
check it out if you want.


Cheers,
Max




More information about the Scummvm-devel mailing list