fix #21976: [REG 2.112.0] Array comparison performance regression#22522
fix #21976: [REG 2.112.0] Array comparison performance regression#22522thewilsonator merged 1 commit intodlang:stablefrom
Conversation
|
Thanks for your pull request, @rainers! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
|
|
This restores the check from but I have no idea why strings have to be excluded (though repe cmpsb might be ok there). Otherwise I get when compiling with -inline. |
restore going through __equals lowering for all arrays but strings
Ah, there is already a test that checks whether a lowering is used or not. Added |
|
#21513 removed the memcmp-optimization from |
|
That said, I think #21513 was actually the wrong way around, moving this use-memcmp logic from druntime back to the compiler (AFAICT, just to have a direct memcmp/rep call for trivially comparable arrays, instead of a |
I saw similar results as with dmd 2.111, so I assumed that there was some memcmp in the __equals implementation. Maybe that doesn't hold when comparing to the glibc-memcmp.
I agree that would be better. I first looked at whether that would be feasible, just to notice that quite some more "backend-opcodes" are implemented doing rep-byte operations. I don't really know the backend and don't want to dive that deep. That would be for someone else to implement...
I also wondered why all these backend and architecture specific details are handled in the frontend, determining whether to invoke __equals or not. |
I'm sure a |
|
Sorry, I measured a slightly modified version, the original test has become a lot worse. Let's revert... |
restore going through __equals lowering for all arrays but strings.
No idea how to test the performance regression that doesn't manifest everywhere.