- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: aCC take long time when using the optimize fl...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-23-2010 02:04 AM
тАО02-23-2010 02:04 AM
aCC take long time when using the optimize flag -O
I use aCC 6.15 under hp ia 64 machine to compile cpp file. Compile will take long time when existing string concatenation with complier flag -O!!!! For a simple cpp, it will take 120 seconds to finish compile.
Is it a bug of aCC 6.15 or anything I can do to speed up the compiling.
Here is the flag I used:
BASE_CCFLAGS=" -AA +DD64 -mt -O"
Here is my cpp file.
#include
#include
using namespace std;
//Macro to print starting and ending tags
#define XML_ELEMENT_BEGIN(x) string("<") + string(x) + string(">")
#define XML_ELEMENT_END(x) string("")
int main()
{
return 0;
}
int buildBrowseReply( string &xml ,int count)
{
string MDS_BROWSE_NODE("Test string");
string MDS_EXPANDABLE("Test string");
string MDS_IMPORTABLE("Test string");
int i=count;
while( i>0 )
{
xml += XML_ELEMENT_BEGIN(MDS_BROWSE_NODE);
xml += XML_ELEMENT_BEGIN(MDS_EXPANDABLE) + MDS_TRUE + XML_ELEMENT_END(MDS_EXPANDABLE);
xml += XML_ELEMENT_BEGIN(MDS_IMPORTABLE) + MDS_FALSE + XML_ELEMENT_END(MDS_IMPORTABLE);
...(Repeat 10 times)
}
}
Here is my compiler and OS infomration:
aCC:
aCC: HP C/aC++ B3910B A.06.15 [May 16 2007]
OS:
HP-UX vanpghpq B.11.23 U ia64
- Tags:
- optimizer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2010 01:51 AM
тАО02-24-2010 01:51 AM
Re: aCC take long time when using the optimize flag -O
I get 600 times slower.
>Is it a bug of A.06.15
No, that's what happens when you optimize straight line code.
On A.06.25, it takes 9 minutes then it drops to +O1:
Warning #20099-D: Exceeding compiler resource limits, routine: buildBrowseReply; some optimizations skipped. Use +Onolimit if override desired.
>anything I can do to speed up the compiling.
Break it up. Turn off inlining with +d or turn it down with +inline_level 1.
Or don't optimize since you can't really improve things.
Or change your code to use string::append.
xml.append("<");
xml.append(MDS_BROWSE_NODE);
xml.append(">");
xml.append("<");
xml.append(MDS_EXPANDABLE);
xml.append(">");
xml.append(MDS_TRUE);
xml.append(" xml.append(MDS_EXPANDABLE);
xml.append(">");
xml.append("<");
xml.append(MDS_IMPORTABLE);
xml.append(">");
xml.append(MDS_TRUE);
xml.append(" xml.append(MDS_IMPORTABLE);
xml.append(">");
xml.append("<");
// ...(Repeat 10 times)
This takes 8 seconds and if you reserve the string space, it could only take one malloc at runtime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2010 07:17 AM
тАО02-25-2010 07:17 AM
Re: aCC take long time when using the optimize flag -O
Optimization should take time. The compiler has to do a lot more work to come up with the "best" binary.
Now it looks from your output that you ran out of resources during the compile and optimization was not complete.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2010 09:07 AM
тАО02-25-2010 09:07 AM
Re: aCC take long time when using the optimize flag -O
Unfortunately in this case the optimizer tries too hard then gives up but wastes all that time. :-(
>Now it looks from your output that you ran out of resources during the compile and optimization was not complete.
(That was my output.)
Unless the code is rewritten like my suggestion, it isn't worth optimizing that large function. You can stop the optimization by using pragmas or use:
+O1=_Z...buildBrowseReply... (Using the mangled name).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2010 08:46 PM
тАО02-25-2010 08:46 PM
Re: aCC take long time when using the optimize flag -O
You can stop the optimization by using pragmas or use:
+O1=_Z16buildBrowseReplyRSsi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2010 09:34 PM
тАО02-25-2010 09:34 PM
Re: aCC take long time when using the optimize flag -O
Thanks for the information. I still have questions.
1. +O1=_Z16buildBrowseReplyRSsi, where do you get this flag? As I can get for the man aCC. Do you have any link to document?
2. Does +O1=_Z16buildBrowseReplyRSsi have the same effect as remove -O?
Thanks.
Allen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2010 10:08 PM
тАО02-25-2010 10:08 PM
Re: aCC take long time when using the optimize flag -O
It's on the man page. +Olevel=name
http://docs.hp.com/en/14487/options.htm#opt+Olevel
>2. Does +O1=_Z16buildBrowseReplyRSsi have the same effect as remove -O?
But only for that one function, buildBrowseReply.