We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34075 ☆ A M B ☆
    • 130 Posts
    One of my clients mostly uses Drupal for their sites. They told me their MODX sites were slower than their Drupal sites.

    At first I could not believe this. After all: everything was cached and loaded fast? Looking at some pingdom.com (and other services) results however, showed me my client was right. MODX was slower on every occasion. Sometimes up to 10 times slower, although mostly 2 to 3 times.

    So I decided to do some more testing on a controlled environment (local pc). I installed both drupal & latest MODX (tested 2.2.0-pl2 & nightly of today). Set both to cache everything and opened up the home pages a few times (to allow caching to occur) as an anonymous user.

    While the source of the Drupal page was a lot larger (it generates a menu and all other kinds of dynamic stuff) it loaded a lot faster than the MODX page which, by default, is empty.
    To make sure this happened all the time I wrote a PHP script that requested both pages 1000 times (file_get_contents() in a loop). It showed me the same result. On average MODX took 111ms where Drupal only needed 34ms.

    This could not be right, so I starting changing some settings in MODX. After a while I found one that saved about 20ms: the session_handler_class setting. After I set that to '' (empty) the homepage loaded a bit faster.

    I guess we could do more to increase the performance of MODX?

    Test environment

    WampServer 2.2 running on Windows 7 64-bit
    Apache 2.2.21
    PHP 5.3.8
    MySQL 5.5.16 [ed. note: jeroenkenters last edited this post 14 years, 7 months ago.]
      Jeroen Kenters

      MODX Professional | MODX Ambassador | Dutch MODX forums moderator

      website | twitter
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      I'm sure the core devs can come up with some methods to speed it up further, but one thing I would love to see is a detailed list of what part of the parsing process takes how long, which will make it easier to find and fix bottlenecks.

      When things cool down here I might see if I can build in a profiling tool which takes measurements in the core (and easy integration with 3PCs) and allows reporting the results in detail from the manager. Got thoughts on how to make that happen (without slowing MODX down, of course!) but too busy to give it some time right now. tongue [ed. note: markh last edited this post 14 years, 7 months ago.]
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 25663 MODX Staff
        • 12,272 Posts
        It'd be interesting to see a more real world test with identical output to keep all things equal in reality. My gut says that it'd be a better starting point, even if it makes Revo look slower still.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 34075 ☆ A M B ☆
          • 130 Posts
          I think that should be the next step. Right now MODX is slower even on empty pages. Once we get that right the next step should be equal output. Which, by the way, I'm already setting up (mirror site of kenters.com in Drupal).
            Jeroen Kenters

            MODX Professional | MODX Ambassador | Dutch MODX forums moderator

            website | twitter
            • 16681
            • 62 Posts
            I will do a lot of work on the caching in the near future. This will use application wide APC opcode cache to cut down load times by storing "compiled" php in memory for reuse. This will take some rework of the current process however as modx does not handle caching of unserialized objects (as far as i can tell).

            l will keep you all informed smiley
              Keep it SIMPLX
              • 16681
              • 62 Posts
              Btw, check out the init process of the modx class and you will find that the boot strapping just to get the system up and running is quite heavy.
                Keep it SIMPLX
                • 30319
                • 406 Posts
                mark's caching articles help...

                http://www.markhamstra.com/modx-blog/2011/10/caching-guidelines-for-modx-revolution/

                http://www.markhamstra.com/modx-blog/2011/11/nested-caching-in-modx-revolution/

                I've seen comments that the IF snippet is really slow, also I think Josh Gulledge did something about caching etc.

                even for small sites like I do this would help a lot
                  • 31246 ☆ A M B ☆
                  • 428 Posts
                  Sorry, for the first time retired,
                  I slightly disagree with Jeroen (@jeroenkenters), I've read before twitter, what are you saying that Drupal generates a page faster than the MODx.
                  I deliberately set at a feeble VPS, pure MODx Revolution 2.2pl -, and Drupal7 last -.
                  Here are the tests with www.vebpagetest:
                  test MODx http://www.webpagetest.org/result/120308_6H_3GX76/
                  test Drupal http://www.webpagetest.org/result/120308_X9_3GX7B/
                  As you can see I'm a bit loaded MODx, but he quickly handles.
                  Well, there's a project where the volume of the test MODx and Drupal are the same.
                  test MODx http://www.webpagetest.org/result/120308_TQ_3GX9V/
                  test Drupal http://www.webpagetest.org/result/120308_X9_3GX7B/
                  As you can see again soon MODx Drupal!

                  I do not see that Drupal was faster MODx, tembolee you say 10 times?? I want notice, MODx takes 10 resources to test a Drupal one. All the default settings, no additional cached. [ed. note: valikras last edited this post 14 years, 7 months ago.]
                    Valentin Rasulov - Industrial design (Hobbies - Web Development)
                    Development not standard projects on CMF MODx Revolution.
                    Small sample of extensions
                    • 34075 ☆ A M B ☆
                    • 130 Posts
                    Quote from: TomMLS at Mar 08, 2012, 03:29 PM
                    mark's caching articles help...

                    They sure do, but in this case the MODX page was empty. No content at all. No chunks/snippets/etc. Just the default template (some basic html).
                      Jeroen Kenters

                      MODX Professional | MODX Ambassador | Dutch MODX forums moderator

                      website | twitter
                      • 34075 ☆ A M B ☆
                      • 130 Posts
                      @Artdevue Did you enable caching in your (second) Drupal setup?
                        Jeroen Kenters

                        MODX Professional | MODX Ambassador | Dutch MODX forums moderator

                        website | twitter