-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #5923 - disambiguate identifier hashing #5926
Fix #5923 - disambiguate identifier hashing #5926
Conversation
29101e2
to
02114a2
Compare
* @return string | ||
*/ | ||
private function hashIdentifier(array $identifier) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!isset($identifier[1])) {
return (string)$identifier[0];
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly, $identifier
is not guaranteed to be 0-indexed
. More keys may exist after that, with undefined values
@Ocramius @guilhermeblanco what should we do with this one? |
@lcobucci I'd say that we need to add benchmarks for these code paths |
@Ocramius alright should we move it to |
@lcobucci 3.x |
@Ocramius any reason for moving it back to |
I want to give this another shot before abandoning all hope: it's a bad one
and it should die
…On 26 Jun 2017 11:13 PM, "Luís Cobucci" ***@***.***> wrote:
@Ocramius <https://github.com/ocramius> any reason for moving it back to
2.6.x?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5926 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakDFthabem878_aMG9h6rhiO7aWQdks5sIB8XgaJpZM4JHdNs>
.
|
0957b8e
to
3de7808
Compare
Benchmark results (with XDebug and without opcache - using #6575)
Summary
|
That is a lot. Assuming that identifiers don't change, except for generated identifiers, the hashing should probably be cached... |
…_encode()` to crash
…identity map lookups (via hash)
3de7808
to
e8cde85
Compare
This PR is wrong. It introduces a behavior worse than we have today. I'm at the point where I have to properly address this issue for once and for all. As soon as you make these type of changes, all EntityPersisters break. The reason is because association identifiers can only go 1 level deep (associated id whose target entity also has associated id are not supported). This would require to completely rewrite both IMHO, we should just close this PR. |
@Ocramius let's close this then? |
Closing is fine by me, but we still need to solve the ID => object problem,
and hashing is a semi-decent solution.
My last attempt used the SplObjectMap (or whatever it was called), and
performance was dreadful. Unless we enforce usage of the php-dd extension,
I don't see this happening 😥
…On 6 Aug 2017 12:56 PM, "Luís Cobucci" ***@***.***> wrote:
@Ocramius <https://github.com/ocramius> let's close this then?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5926 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakPCQwGeHTJUkq2qrE4woHrFKPjguks5sVZvSgaJpZM4JHdNs>
.
|
Delaying to 3.0 - while this is a critical bug, fixing it now is more trouble, as we'd only introduce more dirty hacks. |
I'm closing this PR because it hasn't seen progress for several years. Please open a new one if you want to pick up the work one day. |
Fixes #5923
Requires #5924 to be merged first.