#1510: Time is wasted in Hydration
------------------------------+---------------------------------------------
Reporter: colnector | Owner: romanb
Type: defect | Status: assigned
Priority: critical | Milestone: 1.0.3
Component: Query/Hydration | Version: 1.0.2
Resolution: | Keywords:
Has_test: 0 | Mystatus: Pending Core Response
Has_patch: 0 |
------------------------------+---------------------------------------------
Comment (by romanb):
{{{
As I've seen _gatherRowData() is called only once so it wouldn't really
obfuscate the code including it inside the function.
}}}
Splitting huge methods into smaller ones that each do a small specific
task is not only a matter of DRY. One of the main points is the
readability and maintainability of the code. A bunch of smaller methods
with well-defined tasks are easier to understand than big, deeply-nested
methods. Those are generally a code smell and the reason why "Extract
Method" is a popular refactoring.
{{{
Profiling is a very important tool but code inspection for itself should
not be neglected as sometimes you cover only some of the scenarios with
the profiler.
<snip>
Indeed a profiler is very useful but it has its limitations as the one you
write about previously:
}}}
Code inspection is much more limited than a good tool when it comes to
profiling. All i wanna say is that i will/would not apply a questionable
code change if the claim that it improves performance is not backed up by
a) a good tool or b) the difference is very obvious even in "poor man's
microtime() profiling" like in this example (3secs vs 1min)
While xdebug did not show that the time is wasted by is_array it clearly
shows that its _setLastElement. So its a good hint already. (I would not
have expected that, to be honest).
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1510#comment:13>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---