#1510: Time is wasted in Hydration
-----------------------------------+----------------------------------------
 Reporter:  colnector              |       Owner:  romanb
     Type:  defect                 |      Status:  new   
 Priority:  critical               |   Milestone:        
Component:  Query/Hydration        |     Version:  1.0.2 
 Keywords:                         |    Has_test:  0     
 Mystatus:  Pending Core Response  |   Has_patch:  0     
-----------------------------------+----------------------------------------
 I too often get
 [code]PHP Fatal error:  Maximum execution time of 30 seconds exceeded in
 /var/www/colnect/plugins/sfDoctrinePlugin/lib/doctrine/Doctrine/Hydrator.php
 on line 265[/code]
 So perhaps my queries get too big a result set for hydration but the fact
 that the script always runs out of time on the '''SAME LINE''' is
 suspicious.

 The line in Hydrator.php is
 {{{
 if (is_array($coll) && $coll) {
 }}}

 I've played a bit with it and found out that is_array() is the function
 call that where the code always breaks.
 Since I always use HYDRATE_ARRAY (though I'm unsure whether it has
 anything to do with it) I simply removed the is_array() part from the
 condition to
 {{{
 if (/*is_array($coll) && */$coll) {
 }}}

 and VOILA, the script that couldn't finish in 30 seconds now finishes in
 ~3 seconds!

 I've made the test several times and got the same results.
 Mind that is_array() is a function and not a language construct (like
 isset()) thus can be time consuming.

 Please at least advise on how this condition may be altered as to not harm
 the code or just let me know what it does harm. Thanks.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1510>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to