This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Huge performance difference between read() and fread()
- From: Rutger Hofman <rutger at cs dot vu dot nl>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Wed, 09 Jan 2008 16:13:52 +0100
- Subject: [ECOS] Huge performance difference between read() and fread()
Hi list,
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.
Rutger Hofman
VU Amsterdam
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss