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\PHP5Co
mplexObjectBuilder.php

 

Perhaps somebody finds it useful.

Enjoy

.: Fabian

 


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Attachment: PHP5ComplexObjectBuilder.patch
Description: Binary data

Reply via email to