string literal performance bug?
Dave Gomboc
dave@cs.ualberta.ca
Sun Apr 6 03:44:00 GMT 2003
g++ version: 3.2.2
system type: linux-i686 (AMD Athlon XP)
options gives when g++ was built: unknown
command line triggering bug:
g++ -c string_bank.cpp
compiler output: none -- an indefinite wait.
I'm not sure if a) performance is considered to be a bug, or b) if my
performance expectation is simply unrealistic.
consider the following source file, string_bank.cpp:
extern const char * const my_string_table[5] = {
"I believe that the text in these strings",
"is irrelevant to the example",
"and can be safely ignored.",
"The actual strings are machine-generated and unique,",
"but have significantly overlapping substrings within them.",
};
When compiled in the manner described above, an object file is generated
quickly. However, as the size of my_string_table grows, the compilation
time does not appear to scale linearly. Does it? If not, is it
reasonable to expect it to do so?
I have been able to compile a string table of size one hundred thirty
thousand (all strings initialized in the source code) in a bearable amount
of time (less than a half-hour on a modern PC). I am now trying to
compile a similar string table, but of size seven hundred thirty thousand,
and I've let it run overnight, but compilation hasn't yet completed.
Any workarounds are appreciated. For instance, does the assembler operate
in linear time? Unfortunately, I'm not familiar with the gnu assembler.
Dave
--
Dave Gomboc
M.Sc. Student 1-41 Athabasca Hall
Department of Computing Science Edmonton, Alberta,
University of Alberta Canada T6G 2E5
More information about the Gcc-bugs
mailing list