#1623: implicit save() of associations vs. performance
---------------------------------------+------------------------------------
 Reporter:  floriank                   |       Owner:  jwage  
     Type:  enhancement                |      Status:  new    
 Priority:  minor                      |   Milestone:  1.2.0  
Component:  Attributes                 |     Version:  1.1-DEV
 Keywords:  implicit save performance  |    Has_test:  1      
 Mystatus:  Pending Core Response      |   Has_patch:  1      
---------------------------------------+------------------------------------
Changes (by jwage):

  * milestone:  1.1.0 => 1.2.0


Old description:

> Since my application uses some deep nested sets the performance of saving
> an object (with validation) takes extremely long. This is because
> Doctrine saves (and validates) the record to be saved, its relations, the
> relations of the relations, and so on. As i only change the properties of
> the main-object, one-to-one, one-to-many and first-level many-to-many
> relations i decided to change UnitOfWork->saveAssociations() to only call
> save() if one of its records is modified.
>
> This gives me a huge performance-boost, but at cost of the ability to
> save dirty relations that are deeper than one level in hierarchy. I
> attached testcase plus patch: Maybe someone likes to check and discuss
> this?
>
> Greets,
>
> floriank

New description:

 Since my application uses some deep nested sets the performance of saving
 an object (with validation) takes extremely long. This is because Doctrine
 saves (and validates) the record to be saved, its relations, the relations
 of the relations, and so on. As i only change the properties of the main-
 object, one-to-one, one-to-many and first-level many-to-many relations i
 decided to change UnitOfWork->saveAssociations() to only call save() if
 one of its records is modified.

 This gives me a huge performance-boost, but at cost of the ability to save
 dirty relations that are deeper than one level in hierarchy. I attached
 testcase plus patch: Maybe someone likes to check and discuss this?

 Greets,

 floriank

--

Comment:

 I don't think we can apply this patch because it would break backwards
 compatibility in a bad way. This is the expected behavior and must remain
 this way. The only other option I see is to allow this behavior as
 optional and controlled with an attribute.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1623#comment:2>
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