Re: Basics on real floating types




"Eric Sosman" <esosman@xxxxxxxxxxxxxxxxxxxx> wrote in message news:hdej4u$93t$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
bartc wrote:

"Eric Sosman" <esosman@xxxxxxxxxxxxxxxxxxxx> wrote in message news:hdedcg$q07$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dann Corbit wrote:
[...]
With memory at low, low prices it seem hard to come up with sensible reasons to prefer float over double for the vast majority of applications. [...]

One significant influence can be speed. Memory may be

What happened to your disdain for the little tin god?

What happened to your ability to discriminate between
a (potential) twofold speedup and the overhead of one trivial
function call? Size matters.

There's nothing wrong with it. I've just tested the overhead of adding one extra level of function call to a (admittedly fairly trivial) function. It was something like 50% (and up to 100% on one test). That's not far off the figures you're talking about.

Now an application probably won't spend all it's time calling that wrapper function, but then it might not spend all it's time calculating with floats either.

And of course that extra wrapper code will also require space in the instruction cache. If function call overhead didn't matter than no compiler would ever bother with inlining.

--
Bartc

.



Relevant Pages

  • Re: Basics on real floating types
    ... low prices it seem hard to come up with sensible reasons to prefer float over double for the vast majority of applications. ... I've just tested the overhead of adding one extra level of function call to a function. ... wrapper around a trivial function, ...
    (comp.lang.c)
  • Re: Basics on real floating types
    ... With memory at low, low prices it seem hard to come up with sensible reasons to prefer float over double for the vast majority of applications. ... Cache memory doesn't carry a low, ...
    (comp.lang.c)
  • Re: Basics on real floating types
    ... With memory at low, low prices it seem hard to come up with sensible reasons to prefer float over double for the vast majority of applications. ...
    (comp.lang.c)
  • Be careful when using MMX or Float point instructions in Delphi 2007
    ... For example, FillChar uses ... FLD/FST to fill memory. ... and it also uses X87 instructions. ... There is nothing wrong for a procedure to use float instructions, ...
    (borland.public.delphi.non-technical)
  • Re: Is VC++ 6.0 faster than VC++ .Net and VC# .Net ?
    ... will result in a memory allocation in C# for each iteration but will simply ... result into the re-utilisation of an object allocated on the stack in the ... it's very easy in C++ to use or access unallocated memory or to forget to ... public float Length ...
    (microsoft.public.vstudio.general)