This is the mail archive of the
mailing list for the GCC project.
Re: gcc compile-time performance
"David S. Miller" <email@example.com> writes:
> From: firstname.lastname@example.org (Robert Dewar)
> Date: Sun, 19 May 2002 08:10:15 -0400 (EDT)
> Depending on the source representation, this is something that should only
> cost when used, and it won't be used much in practice.
> The minimum is a function call per character, that can't
> cost the same as a simple char dereference.
You ought to be able to optimise this down to a single array or bitmap
lookup per character, to determine whether the character is the first
one of a multibyte sequence or a state-changing character. The C
standard guarantees that most of the characters that appear in a C
program are always single bytes, so it'll be rare that you ever have
to actually call back to the C library.
- Geoffrey Keating <email@example.com> <firstname.lastname@example.org>