Summary: Use memcmp or other appropriate optimizations for
                    array comparison where possible
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from Jonathan M Davis <> 2010-11-27 22:30:10 
PST ---
This thread makes it fairly clear that in some cases, array comparisons in D
are unnecessarily slow:

What likely should be done is to use memcmp in cases where you don't actually
need to call opEquals() on the individual elements of the arrays - such as when
comparing arrays of primitives or arrays of structs where none of the struct's
member variables have opEquals() (be they primitives or structs without an
opEquals() and no member variables with opEquals()). strings would naturally be
among the types which would benefit from the optimization.

Other optimizations for speeding up array comparisons may be appropriate, but I
do think that it's clear that array comparisons can be better optimized in many
common cases. Obviously, this isn't a high priority, but I do think that this
is an optimization which should be added at some point if we really want D to
be as fast as it should be.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to