X[]==Y[] is 7X slower than it should be -- why?

torhu no at spam.invalid
Sat Jun 21 18:46:37 PDT 2008


downs wrote:
> Sean Kelly wrote:
>> Are the braces really necessary for the comparison though?  I'd just do "X == Y."
>> I wouldn't expect a speed difference, but the cycle count has be wondering if
>> by adding the braces the generated code is cloning the arrays before comparing
>> them or something like that.
>> 
> No, array[] is just the full slice, i.e. the equivalent of [0 .. $].
> 
> It's useful for static arrays, as it effectively turns them into dynamic ones.
> 
I wish you didn't say that.  Yet another undocumented feature to try to 
remember?



More information about the Digitalmars-d mailing list