Linux vs. libio
Ulrich Drepper
drepper@cygnus.com
Fri Dec 31 23:54:00 GMT 1999
Kevin Atkinson <kevinatk@home.com> writes:
> Will that extra level of indirection *really* make a diffrence in speed I
> mean IO is something which is fairly slow in the first place.
No, it's not slow. What Per is talking about are functions like
fputc, fgetc, also fputs, fgets etc. These work on buffers and
normally don't include file operations. And so it is a big handicap
to have extra indirection.
And something which wasn't mentioned: this methods requires a lot of
porting to each new platform (just look at how many platforms SGI's
stuff is working) and, perhaps more important, it is very risky. The
libc is free to change the internals of the FILE structure since it is
an opaque type. In glibc 2.2, for example, there will be support for
wide characters. And the relations between the different buffers in
this context is really complicated.
So, manipulating the pointers in the FILE struct is not only slower,
it's also far less portable.
--
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------
More information about the Gcc
mailing list