This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Factorize the two read_line functions present in gcov.c and input.c


On Thu, Nov 07, 2013 at 01:25:00PM +0100, Bernd Edlinger wrote:
> just some thoughts...
> 
> 
> fgetc will definitely be much faster than fread 16K and fseek back to the end of line position.
> 
> Note: fgetc is already buffered and not too slow on average, but only if you do not
> fseek around. In that case the buffered file-stream data is lost.

fgetc (unless you are talking about fgetc_unlocked which is somewhat better)
is actually very expensive.  Of course, fseek is highly undersirable, but
I've already said that.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]