|
|
Rockbox mail archiveSubject: Re: file read/write codeFrom: Björn Stenberg (bjorn_at_haxx.se) Date: 2002-11-08
Greg Haerr wrote:
Correct me if I'm wrong, but it looks like you sacrify 50% transfer speed for simpler code.
Your code buffers all sectors. That's what makes it simple - read() does not need to bother about which sectors are cached and not. It just memcpies everything. The penalty is harsh, though. Your code copies every byte twice (disk->buffer, buffer->target), while the current code only copies once (disk->target, except for head and tail bytes).
Is there a simple way around this that I don't see?
> Take a look at the gcc -S output and you'll see huge differences
Thanks for the heads-up. Although I prefer to use unsigned int rather than long.
-- Björn
Page was last modified "Mar 9 2008" The Rockbox Crew |