c++ - empty base class optimization
- Laurentiu Pancescu (13/13) Mar 26 2002 In an article by Nathan Myers (http://www.cantrip.org/emptyopt.html),
- Walter (7/19) Mar 26 2002 It isn't done in DMC in order to have the objects binary compatible with
- Christof Meerwald (4/13) Mar 27 2002 But at least version 6.0 of Microsoft Visual C++ does implement the empt...
- Walter (4/6) Mar 28 2002 Just checked, you're right, it does. I'll go ahead and implement it for
- Laurentiu Pancescu (11/19) Mar 27 2002 find
- Walter (13/20) Mar 27 2002 MSVC6
In an article by Nathan Myers (http://www.cantrip.org/emptyopt.html), amongst the compilers that support the empty base class optimization was also Symantec. However, DMC doesn't do that by default, and I didn't find any mention to that in documentation. Is it supported by DMC? While looking in the old help files (after looking in the new HTML docs, of course :), I saw a section about internal limits of DMC: no more than 254 chars in identifiers. Does this apply to *my* identifiers, or to the mangled names that DMC generates? I encountered such issues related to mangled names maximum length in MSVC6, I just couldn't debug a program that had a map<string, map<string, string> >, because of that limit (it linked and executed fine in release mode, though). I hope it's not the case with DMC, is it? Laurentiu
Mar 26 2002
"Laurentiu Pancescu" <user domain.invalid> wrote in message news:a7qkp1$17gg$1 digitaldaemon.com...In an article by Nathan Myers (http://www.cantrip.org/emptyopt.html), amongst the compilers that support the empty base class optimization was also Symantec. However, DMC doesn't do that by default, and I didn't find any mention to that in documentation. Is it supported by DMC?It isn't done in DMC in order to have the objects binary compatible with Microsoft C.While looking in the old help files (after looking in the new HTML docs,ofcourse :), I saw a section about internal limits of DMC: no more than 254 chars in identifiers. Does this apply to *my* identifiers, or to the mangled names that DMC generates? I encountered such issues related to mangled names maximum length in MSVC6, I just couldn't debug a programthathad a map<string, map<string, string> >, because of that limit (it linked and executed fine in release mode, though). I hope it's not the case with DMC, is it?It's around 900 for DMC, and it's after mangling.
Mar 26 2002
On 27 Mar 2002, Walter wrote:"Laurentiu Pancescu" <user domain.invalid> wrote in message news:a7qkp1$17gg$1 digitaldaemon.com...But at least version 6.0 of Microsoft Visual C++ does implement the empty base class optimization. bye, ChristofIn an article by Nathan Myers (http://www.cantrip.org/emptyopt.html), amongst the compilers that support the empty base class optimization was also Symantec. However, DMC doesn't do that by default, and I didn't find any mention to that in documentation. Is it supported by DMC?It isn't done in DMC in order to have the objects binary compatible with Microsoft C.
Mar 27 2002
"Christof Meerwald" <cmeerw web.de> wrote in message news:a7s2fe$2131$1 digitaldaemon.com...But at least version 6.0 of Microsoft Visual C++ does implement the empty base class optimization.Just checked, you're right, it does. I'll go ahead and implement it for 8.28.
Mar 28 2002
"Walter" <walter digitalmars.com> wrote in message news:a7r6g6$1i05$1 digitaldaemon.com..."Laurentiu Pancescu" <user domain.invalid> wrote in message news:a7qkp1$17gg$1 digitaldaemon.com...findIn an article by Nathan Myers (http://www.cantrip.org/emptyopt.html), amongst the compilers that support the empty base class optimization was also Symantec. However, DMC doesn't do that by default, and I didn'tMSVC6 does this optimization by default, I just checked yesterday - is MSVC6 what you mean by "Microsoft C"? BCC and gcc have this available, but not active by default. It could speed up STL operation (see the article in the original post, someone from Watcom said that it improved STL performance by 30% with their compiler), and reduce memory consumption of EXEs using STL. Would it be hard to do (or to put back, if Symantec C++ had it)? Eventually with a command line switch to activate it? Laurentiuany mention to that in documentation. Is it supported by DMC?It isn't done in DMC in order to have the objects binary compatible with Microsoft C.
Mar 27 2002
"Laurentiu Pancescu" <user invalid.domain> wrote in message news:a7s2p4$21gs$1 digitaldaemon.com...MSVC6 does this optimization by default, I just checked yesterday - isMSVC6what you mean by "Microsoft C"?It was an earlier version we tried to be compatible with. BCC and gcc have this available, but notactive by default. It could speed up STL operation (see the article intheoriginal post, someone from Watcom said that it improved STL performanceby30% with their compiler), and reduce memory consumption of EXEs using STL. Would it be hard to do (or to put back, if Symantec C++ had it)?Eventuallywith a command line switch to activate it?I find it amusing that this is called an "optimization", because that's what the compiler did originally. It required extra work to "deoptimize" it to be compatible with VC. It's likely it wouldn't be too much trouble to remove that kludge, but I worry about breaking compatibility with some existing library.
Mar 27 2002