C++ Logo

std-discussion

Advanced search

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

From: Mandeep Sandhu <mandeepsandhu.chd_at_[hidden]>
Date: Thu, 9 Jul 2020 14:46:56 -0700
> Moreover, there's also the problem that some features can be misused or
> abused. Creating 50k std::string in the same function is probably a bad idea,
> let alone in the same statement.

This isn't in a function, but in a header. Its static inventory list,
which needs to be frequently checked for item membership (hence a set)
and for performance reasons we'd like to have it ready before use.

The inventory list is available as a JSON array, so I can also read it
once at program startup and populate a set with it (I'll probably do
this if there's nothing I can do to improve the compile time of the
current approach).

> The exception handling code that needs to be generated will be enormous.

Do you mean the code to _generate_ exception from the constructor? I'm
not sure I follow you here.

-mandeep




>
> Just because something is possible doesn't mean it's sensible to do it. And in
> this example, clearly there are better ways of achieving the goal.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Software Architect - Intel System Software Products
>
>
>
> --
> Std-Discussion mailing list
> Std-Discussion_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion

Received on 2020-07-09 16:50:31