Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-718

Bottleneck in computeAssociationChanges()?

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      It seems that since DDC-600 computeAssociationChanges() iterate over entries of an collections, even if they are not marked as cascadePersist. For large, hydrated collections this could potentially become a bottleneck.

      Wouldn't it be better to save the "addedEntities" in an additional map inside "PersistentCollection" and retrieve those instead of calling $value->unwrap() ?

        Issue Links

          Activity

          Benjamin Eberlei created issue -
          Benjamin Eberlei made changes -
          Field Original Value New Value
          Link This issue relates to DDC-600 [ DDC-600 ]
          Hide
          Roman S. Borschel added a comment - - edited

          Do you have any numbers to back this up? With large, hydrated collections the bottlenecks are likely elsewhere (SQL query, hydration)

          Further, maintaining "addedEntities" is not as trivial as you might think. The current approach does not care about what happens in-between, it just computes a diff between the old and new state of the collection at commit time. Tracking added/removed objects as they come in and go is more cumbersome.

          Show
          Roman S. Borschel added a comment - - edited Do you have any numbers to back this up? With large, hydrated collections the bottlenecks are likely elsewhere (SQL query, hydration) Further, maintaining "addedEntities" is not as trivial as you might think. The current approach does not care about what happens in-between, it just computes a diff between the old and new state of the collection at commit time. Tracking added/removed objects as they come in and go is more cumbersome.
          Roman S. Borschel made changes -
          Priority Major [ 3 ] Minor [ 4 ]
          Hide
          Benjamin Eberlei added a comment -

          no numbers, i was just confused about the code, because i remembered it differently

          Show
          Benjamin Eberlei added a comment - no numbers, i was just confused about the code, because i remembered it differently
          Benjamin Eberlei made changes -
          Workflow jira [ 11677 ] jira-feedback [ 13867 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback [ 13867 ] jira-feedback2 [ 15731 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback2 [ 15731 ] jira-feedback3 [ 17988 ]

          This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

          • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-718, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

            People

            • Assignee:
              Roman S. Borschel
              Reporter:
              Benjamin Eberlei
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: