finding the minimum allowed value for a type

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Frank Schmitt

    #16
    Re: finding the minimum allowed value for a type

    Jerry Coffin <jcoffin@taeus. com> writes:
    [color=blue]
    > In article <bl3du4$45a@dis patch.concentri c.net>, gi2nospam@maria ni.ws
    > says...
    >
    > [ ... ]
    >[color=green]
    > > The code above took 3min 14sec in compilation time on a 800Mhz x86-P3
    > > machine with gcc 3.3.1 with the -ftemplate-depth-10000 flag.[/color]
    >
    > Hmmm...strange -- it gave identical results for me, but compiled in only
    > 21 seconds with gcc 3.2 (the mingw port). This was on a 1.2 GHz P3, so
    > I expected it to be a _little_ faster, but not nearly this much.[/color]

    Hm. gcc 3.3 seems to take longer than gcc 3.2. With
    g++3 -ftemplate-depth-10000 -Wreturn-type -W -Wpointer-arith -pipe -ggdb
    it compiled in 17 seconds with gcc 3.3.1 (RH Linux 7.3) on a 2.2 GHz P4.

    regards
    frank

    --
    Frank Schmitt
    4SC AG phone: +49 89 700763-0
    e-mail: frankNO DOT SPAMschmitt AT 4sc DOT com

    Comment

    • Gianni Mariani

      #17
      Re: finding the minimum allowed value for a type

      Frank Schmitt wrote:
      ....[color=blue]
      >
      > Hm. gcc 3.3 seems to take longer than gcc 3.2. With
      > g++3 -ftemplate-depth-10000 -Wreturn-type -W -Wpointer-arith -pipe -ggdb
      > it compiled in 17 seconds with gcc 3.3.1 (RH Linux 7.3) on a 2.2 GHz P4.[/color]

      It turns out the machine I used to run the compiler had a runaway
      process in the background - I wondered why it was sliggish ...

      New processing time is :
      31.050u 0.690s 0:32.96 96.2% 0+0k 0+0io 4206pf+0w

      Which is inline with expectations.

      Still, 20-30 seconds to compile is a bit excessive.

      The other issue is that the debug information is also excessive - I'm
      not sure what impact that would have except long link times and lots of
      disk usage.

      Comment

      • Adam H. Peterson

        #18
        Re: finding the minimum allowed value for a type

        > I think you could test numeric_limits< T>::is_integer[color=blue]
        > and numeric_limits< T>::is_signed to do special
        > processing for floating point types, e.g. what
        > Ron showed: -numeric_limits< T>::max()
        >
        > -Mike[/color]

        Thanks. I think what Ron wrote will meet my needs. (For some reason,
        his post doesn't show up on my news server, and I can only see it
        through Google groups. Oh, well.) It's nice that there seems to be a
        relatively simple portable standard solution.

        Although, if I may say so, it seems to me like the specialized behavior
        of min() for floating point types is less than helpful for generic
        programming, and it would have been better to have another
        numeric_limits member serve that purpose, giving min() a more consistent
        usable behavior.

        Thanks for the responses, all.

        Adam H. Peterson

        Comment

        Working...