On Sunday, 29 May 2016 at 17:13:49 UTC, qznc wrote:
Given two string (or char[] or ubyte[]) objects, I want to compare them. The naive loop accesses the arrays byte-wise. How could I turn this into a word-wise compare for better performance?Is a cast into size_t[] ok? Some Phobos helper functions?
Assuming you don't have codepoints and only want to do a raw compare, i believe you can as long as the sizes align.