-
-
Notifications
You must be signed in to change notification settings - Fork 586
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
Generated hydrators #933
base: master
Are you sure you want to change the base?
Generated hydrators #933
Conversation
@Majkl578 What do you think? |
I have checked the approach used internally by ocraminus, in reality used |
Yes, that is true. But he does that at once for whole object, not per-property. Calling closure per property (imagine 30 properties per object) will be slower than calling it once for all :) |
the version in this PR is 10% slower that the current master... 😕 .... still to figure out why. |
As noted on Slack:
|
$this->gen[$class] = new $hydratorClass(); | ||
} | ||
|
||
return $this->gen[$class]->extract($object); |
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.
@Majkl578 generators are generated and cached, so is "production" ready after the warmup.
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.
The code inside the "if" is never executed during the benchmark, so should not make it slower
tried to implement #904, but for now looks slower...must be doing something wrong