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] Speed-up get_identifier("main")


Roger Sayle wrote:

The one minor wart with this patch is that the java front-end already
defines a GET_IDENTIFIER macro.  I work around this inconvenience by
renaming that macro as JAVA_GET_IDENTIFIER.  I hope the java folks don't
mind; Java will be one of the big winners from this clean-up.  I really
prefer to use "GET_IDENTIFIER" as it avoids having to think about
indentation during the mostly mechanical conversion process.

It might be cleaner to dump GET_IDENTIFIER in Java, and just do in jv-scan.c: #define get_identifier(S) xstrdup(S)

A further optimization would be to pre-calculate the hash values.
I don't know if the compiler is could be made to inline calc_hash,
but if not we could do build-time pre-processing.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/



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