C++ Logo


Advanced search

Re: extremely long compile time with large number of string literals

From: Roman Babinicz <rb_at_[hidden]>
Date: Wed, 5 Aug 2020 18:08:02 +0200
On 09/07/2020 08:22, Artur Czajkowski via Std-Discussion wrote:
> You (the committee) are destroying the C++ language.

Your anger is misplaced, it is the developers of compiler who decide how
efficient and fast the compilation will be.

There is nothing in the standard that would make it extra hard to write
a compiler that compiles such code in efficient manner;
E.g. if standard would require that two string literals share some
address or otherwise "foo"=="foo" is always true, then it might require
additional step, that sounds quadratic O(n²) in naive implementation.

Perhaps there are GCC options related to string compilation, maybe GCC
tries to optimize identical strings and spends time doing just that or

Contact GCC developers, or perhaps use other compiler like clang.

Received on 2020-08-05 11:11:30