https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80290

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
For an unoptimized compiler the profile points at conversion_obstack_alloc
called 16 million times when simplifying the testcase to contain a single
initializer element.

Note we essentially have a std::map<unsigned, std::map<std::string,
std::map<std::string, std::map<std::string, std::map<std::string, std::string>
> > > > initializer.

Simplifying the initializer down to

extern const FruMap frus = {
   {1,{
         {"/system/chassis/motherboard/cpu0",{
             {"xyz.openbmc_project.Inventory.Decorator.Asset",{
                 {"PartNumber",{
                     {"IPMIFruSection","Board"},
                 }},
             }},
        }},
   }},
};

shows that adding another element to the innermost map increases memory use
from
107MB to 124MB.  So even individual elements are quite costly.

For the above simplest case we still have 1.4 _million_ calls to
conversion_obstack_alloc.

The C++ code is also a heavy allocator of tree vectors and tree lists during
overload resolution / template instantiation and matching.

Reply via email to