We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18397
    • 3,250 Posts
    While looking at optimizing Ditto I uncovered something interesting.

    I ran the same test snippet, only changing the API call from getActiveChildren to getDocumentChildren. I figured there wouldn’t be much of a difference.

    The results on a directory with over 1,000 subdocuments (randomly generated via a new tool I will release that creates dummy docs) were as follows:

    getActiveChildren took 0.168 seconds to generate the uncached page with uncached snippet call.

    getDocumentChildren took 0.784 seconds to generate the same page.

    Could someone please enlighten me as to why there is such a significant speed difference between two very similar calls.
      • 18397
      • 3,250 Posts
      I just figured it out. The difference between all fields and only "id, pagetitle, description, parent, alias, menutitle" is the cause of the speed difference.

      Still, why would the difference be so great?
        • 22303 MODX Staff
        • 10,725 Posts
        Quote from: Mark at Jul 28, 2006, 10:12 AM

        I just figured it out. The difference between all fields and only "id, pagetitle, description, parent, alias, menutitle" is the cause of the speed difference.

        Still, why would the difference be so great?

        The more columns you select, the larger the footprint of the result, and thus the longer it takes to transfer between the db and the PHP process. It’s simply the amount of data being sent across the pipes.