Ok, I played around with the clock_xx() functions a bit more and have got some results that are repeatable, so I'm a bit happier now. Bear in mind that these figures are only accurate to 1/6 of a second.
Test: 512byte sector from SD card
Time: 0 s, 0 ticks - less than one vsync interval or clock 'tick'.
Test: 64kbyte read from SD card
Time: 0 sec 37 ticks
Test: 128kbyte read from SD card
Time: 1 sec, 15 ticks
Test: 256kbyte read from SD card
Time: 2 sec, 30 ticks
Test: 512kbyte read from SD card
Time: 4s, 59 ticks (lets say 5 sec)
I work that out to be a transfer rate of approximately 115kbytes/second. That's really not bad at all. I would think that with some optimisation we could get pretty damn close to the speed of the CDROM drive, with, of course, a hell of a lot lower latency in access time.
Notes:
[ul][li]All tests where done after a call to fopen() - so the time to seek to a file and find it's directory entry were not considered (will be dependent on directory hierarchy).[/li][li]The test was fairly dumb - just sequential sector reads, I'm not even paying any notice of where the file ends yet.[/li][li]I'm recalculating LBA address from the file cluster number on each successive 512byte read, my 32bit math multiplication function, well, isn't multiplication at all, it's a massive huge hack in the form of an add, so there are definite savings to be made there.[/li][li]A cluster <-> LBA sector lookup for the most recently accessed file entries would be worthwhile looking at too - it depends on how often you reopen the same file or indeed how slow that is (next test!).[/li][li]There will be some overhead in retrieving clock_tt(), clock_ss() etc, at the end of each test, but the speed seems to be consistent between the different transfer tests so I would imagine it's a very small, consistent error number.[/li][/ul]