Conversation
|
It's the first time I hear about array_merge not being "good", do you have a link that explains it? |
|
Hm I remember people like dunglas or ocramius mentioning it, verbally or on Twitter and I can't find a proper source on it. However in good faith, here's a profiling: https://blackfire.io/profiles/compare/5e336e69-c114-4c83-9fe5-e360e777d39d/graph. Note that the benchmark I've made is not tweaked to highlight the issue (I didn't bother creating two or three parent classes with lots of properties). |
|
👍 thanks for the profile link |
|
@theofidry this PR had to be reverted, see #50 |
|
@Slamdunk see my comment on it, I don't think it needs to be reverted the fix is easy. Sorry to have broke things though, it's good to have a test for it now |
|
👍 it's okay shit happens, I'm sorry too for not spotting that when reviewing the PR. I had a look at PHPUnit issues and there was no issue open about it so it doesn't seem like things broke for too many people. Indeed the fix could have been different but as a first step it's a safe choice. I'm fine with another PR that restores the perf improvement with a few extra tests. |
|
@mnapoli yeah I'm gonna redo a PR making sure we have a test case for it as well :) |
On the same token as #44.
array_mergecan be quite nasty as it creates a brand new array and copy the values of the two arrays being merged into it.