Mail Archives: djgpp/2004/12/26/16:50:48
> He is using DJGPP 2.8.0, and I have 2.953, and
Those are GCC version numbers, not djgpp version numbers. DJGPP
version numbers can be found in manifest/djdev*.ver or
include/sys/version.h
fseek() and fread() are funny under DJGPP, because they try to guess
what type of buffering scheme will work best for your program. In
general, this system gives better *overall* performance, although it's
always possible to create test cases that show worse performance.
Each time you fread() in sequence, DJGPP increases the read-ahead
buffer size. If you end up reading the whole file sequentially, this
results in a dramatic speedup. If, however, you fseek(), the buffer
is reset to its smallest size. This avoids reading in sectors that
may not be used, and optimizes small random access reads.
Also, fseek() may end up discarding the buffer. If it does this when
it doesn't need to, that might be an opportunity for optimization.
Without seeing an actual complete test program, we can't say much
more. For example, how big is Forward_Bytes? How many bytes are you
reading at a time? How much total data is being read? Having a
working program to play with lets us investigate these kinds of
issues.
As for the arrays, we can't say much without a test program, because
there's too many variables. Note that arrays require a certain amount
of math to index into each dimension, that could add up to more math
than just recomputing the values.
- Raw text -