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

2020-07-09 Thread Mandeep Sandhu via Gcc-bugs
On Thu, Jul 9, 2020 at 1:33 AM Jonathan Wakely  wrote:
>
> > I'm not sure if this is the right mailing list for asking about
>
> No it's not, this list is for automated mails from our bug database.
>
> > (possible) g++ issues. If not, I'd appreciate it if someone can point
> > me to the right one.
>
> See https://gcc.gnu.org/lists.html which tells you that gcc-help is
> the right list.

Thanks Jonathan! I'll post my question there.

-mandeep

>
>


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

2020-07-09 Thread Jonathan Wakely via Gcc-bugs
> I'm not sure if this is the right mailing list for asking about

No it's not, this list is for automated mails from our bug database.

> (possible) g++ issues. If not, I'd appreciate it if someone can point
> me to the right one.

See https://gcc.gnu.org/lists.html which tells you that gcc-help is
the right list.




stdc++ issue: extremely long compile time with large number of string literals

2020-07-08 Thread Mandeep Sandhu via Gcc-bugs
Hi All,

I'm not sure if this is the right mailing list for asking about
(possible) g++ issues. If not, I'd appreciate it if someone can point
me to the right one.

With that said, here goes...

I have an strange (to me) issue, where trying to compile a header
which has a single "std::unordered_set" initialized with
around 50K short strings is taking forever.

The set is declared as:
const std::unordered_set my_set ({"item1", "item2", });

(The header is auto-generated using a script which takes a JSON array
and puts its elements in an unordered_set)

I understand that creation of many strings has an overhead, but this
issue seems to
affect compilation time, not runtime.

Can someone explain to me why it takes such a long time to compile?
Keeping the strings to under 5K, makes the program compile in about 8
secs.

I'm using the following compiler on Linux:
$ g++ --version
g++ (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks for your time.

-mandeep