Rockbox mail archiveSubject: Re: file read/write code
From: Björn Stenberg (bjorn_at_haxx.se)
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.
Page was last modified "Jan 10 2012" The Rockbox Crew