Sound like a good idea, if you have tested this patch and if it give a real + 
with perf
I suppose this kind of bugs is already corrected in propel 1.3b 

----- Message d'origine ----
De : Fabian Lange <[EMAIL PROTECTED]>
À : [email protected]
Envoyé le : Mercredi, 10 Octobre 2007, 19h44mn 31s
Objet : [symfony-devs] Performance Patch for Propel




 
 

 

 


<!--

 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times 
New Roman";}
a:link, span.MsoHyperlink
        {color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;text-decoration:underline;}
span.EmailStyle17
        {font-family:Arial;color:windowtext;}
 _filtered {margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {}
-->






Hi,
 

when doing some performance optimisations for our app
we found out an issue with Propel generated base classes.
 

  
 

Lets have a look at this thing:
 

            public function getEntity($con = null)
 

            {
 

include_once
'lib/model/om/BaseEntityPeer.php';
 

                        if ($this->aEntity ===
null && ($this->entity_gid !== null)) {
 

                                   $this->aEntity
= EntityPeer::retrieveByPK($this->entity_gid, $con);                     
 

                        }
 

                        return $this->aEntity;
 

            }
 

You can see that this will ever include_once the BaseEntityPeer.
 

We all know that this comes with a performance hit.
 

So for that reason:
 

  
 

$entity = $myObject->getEntity();
 

echo($entity);
 

echo($entity);
 

  
 

is faster than:
 

echo($myObject->getEntity());
 

echo($myObject->getEntity());
 

  
 

of course that shouldn’t be.
 

A very tiny patch to propel class would generate the
include_once inside the if, where its actually needed.
 

  
 

I proposed this already for 1.0.8 but I do not know
if it gets accepted. So Ill 
post this here:
 

Attached patch for
 

symfony\vendor\propel-generator\classes\propel\engine\builder\om\php5\PHP5ComplexObjectBuilder.php
 

  
 

Perhaps somebody finds it useful.
 

Enjoy
 

.: Fabian
 

  
 















      
_____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" 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.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to