g++ compiler question!

Discussion in 'C++' started by aamir, Jun 13, 2006.

  1. aamir

    aamir Guest

    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
     
    aamir, Jun 13, 2006
    #1
    1. Advertising

  2. aamir

    Ian Collins Guest

    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.
     
    Ian Collins, Jun 13, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yan
    Replies:
    0
    Views:
    1,141
  2. Jack Wright
    Replies:
    5
    Views:
    629
    Shiv Kumar
    Jan 19, 2004
  3. Ram
    Replies:
    0
    Views:
    2,848
  4. Andrey Batyuck

    Compiler compiler with C++ as output

    Andrey Batyuck, May 11, 2004, in forum: C++
    Replies:
    3
    Views:
    443
    Frederik Hertzum
    May 17, 2004
  5. RickMuller
    Replies:
    4
    Views:
    712
    Alexey Shamrin
    Mar 26, 2005
Loading...

Share This Page