By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,852 Members | 2,219 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,852 IT Pros & Developers. It's quick & easy.

g++ compiler question!

P: n/a
Hi,

When I compile my program adding -O option, the running time of my
program is much smaller. For example if i compile my program like this

g++ -Wall -g prog2.cc avltree.cc cells_list.cc hashsep_query.cc
hashsep_point.cc int_list.cc loadavltree.cc -o p2 -lm

its run time is around 12 seconds.

but if i compile it with

g++ -Wall -g -O prog2.cc avltree.cc cells_list.cc hashsep_query.cc
hashsep_point.cc int_list.cc loadavltree.cc -o p2 -lm

its run time is around 7 seconds.
I am really new at C++ so can't figure it out why is it so different.
Any idea?

Thanks,
Aamir

Jun 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
aamir wrote:
Hi,

When I compile my program adding -O option, the running time of my
program is much smaller.


Read the man page and please don't multi-post. If you want to post to
more than one group, cross-post.

--
Ian Collins.
Jun 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.