[ECOS] Huge performance difference between read() and fread()
Wed Jan 9 15:13:00 GMT 2008
I have a board with an PXA270 and 32MB of flash, part of which is
configured as a jffs2 flash file system with Flash/v2 and legacy
interface. I also have language/C and many other C components configured
in, the relevant functions are open()/read() and fopen()/fread().
Now, if I read a file of size 503549 on this jffs2 file system, the
performance is *wildly* different for read() and fread():
file "/fpga/guardian_v3_rev_b.svf" size 503549
read file /fpga/guardian_v3_rev_b.svf size 503549 takes 0.863116
fread file /fpga/guardian_v3_rev_b.svf size 503549 takes 16.601978
Times are in seconds.
Question: why are the timings a factor of 20 apart? Why are the timings
different at all? I'd think that both do more or less exactly the same
thing, although at a different interface.
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss