Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2921

[GH-912] Avoid PersistentCollection::isEmpty() to fully load the collection.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      This issue is created automatically through a Github pull request on behalf of BenMorel:

      Url: https://github.com/doctrine/doctrine2/pull/912

      Message:

      This is a suggested simple performance improvement for `PersistentCollection`.

      At the moment, `isEmpty()` always fully loads the collection. By changing the code to rely on `count()`, which makes advantage of extra lazy fetch when the collection is not loaded, this saves the overhead of loading the entire collection when one just wants to check whether the collection is empty.

        Activity

        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-912] was closed:
        https://github.com/doctrine/doctrine2/pull/912

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-912] was closed: https://github.com/doctrine/doctrine2/pull/912

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Doctrine Bot
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: