http://d.puremagic.com/issues/show_bug.cgi?id=9477
Summary: String (and array) comparisons are needlessly very
slow
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: performance
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Vladimir Panteleev <[email protected]> 2013-02-08
11:18:10 EET ---
While profiling one of my programs, I've noticed a performance issue in an area
that I wouldn't expect to be slow: string comparisons.
It looks like array comparisons go through the rather convoluted TypeInfo
equality code, which contains a few indirect calls and calls to runtime code.
It can be inlined/optimized to a length comparison and a memcmp call.
If the length is known (static arrays), the length check can be skipped, and
for short arrays the comparison can even be inlined. Bearophile previously
reported this problem for static arrays in issue 6658.
I should note that a slice copy currently compiles to a memcpy call.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------