D-Programming-Language/dmd — pull request #1234 by donc (2012-10-29 12:33:08+00:00)
Title: CTFE: reduce memory usage for array comparisons

Things like "if (v == str)" always created a useless memory allocation, whenever v was a slice of another array. This is because it used to be implemented with constfold.Equals(), which couldn't handle CTFE-interal slice expressions. Ditto for Identity() and Cmp().
But the new functions ctfeEqual, ctfeIdentity, ctfeCmp support slices now, so the resolveSlice
call is no longer required. This could have a large performance impact for string comparisons.

The second commit does the same thing for strings in case statements and AA literals, but that's just for completeness -- I don't expect the performance impact to be large.