object.opEquals return type

Dan murpsoft at hotmail.com
Wed Feb 27 16:01:32 PST 2008


Frank Benoit Wrote:

> 
> Putting the int/bool performance difference in relation to the whole thing:
> Calling opEquals makes a virtual function call. Then at least the given 
> object reference is compared once against this. For a useful opEquals 
> much more can happen, eg. a dynamic cast...
> Now, is it still a _relevant_ performance hit (if any), to use bool 
> instead of int here?
> 

I never thought it was.

Too many people think "oh, it's inefficient to use more than a bit" but fail to recognize that x86 machine code has a finite discrete set of instructions which operate on finite discrete operand sizes.

It really was time to set up a new platform decades ago - too bad Intel tanked the Itanic.

Regards,
Dan



More information about the Digitalmars-d mailing list