We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    As advSearch works with TVs last time I checked - how's that handled? Are there any TVs in the slow install that don't exist in the fast one? Any chance there's values in the DB that don't match the resources due to the importing you've done?
    No. I use a debug mode which log the sql request done to the database. And When I execute under PhpMyAdmin the request, I get the same level of performance. This is clearly not related to mysql. I get the same request, the same results and the same time of execution.

    I followed the two environments under the xdebugger profiler and the main difference happens in Revo functions like modChunk->process (with modParser->processTag)
      • 5811
      • 1,717 Posts
      On this page you could see screenshots of cachegrind.

      200ms for advsearchutil.processChunk for the first environment and 2981 ms for the second environment.
      with advsearchutil.processChunk :
          public function processChunk($name, $properties = array()) {
              $chunk = $this->chunks[$name];
      		if (!empty($chunk)) {
      			$chunk->_processed = false;
      			return $chunk->process($properties);
      		}
      		else return '';
          }

      • That page is giving a 404 so I'm not seeing anything.

        You say the processTag function is showing up as taking more time on the second install. Can you show the chunks you are using?

        And BTW - you still didn't answer my question. I asked about any data that may not properly be linked to existing resources/tvs or if there are other TVs in the second install, not about requests or return values.

        Does the order in which you test the installs matter, ie if you test one first - and then the other, or the other way around, does that influence the results? (thinking of the server recovering from a high load situation that can slow down a second request some time after the first).
          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.
          • 5811
          • 1,717 Posts
          That page is giving a 404 so I'm not seeing anything
          : ok page now published.Now unpublished.

          The chunk used are the followings:

          Paging1: Chunk called by getpaging
          [[+previouslink:isnot=``:then=`<span class="advsea-previous"><a href="[[+previouslink]]">Previous</a></span>`]]<span class="advsea-current"> [[+first]] - [[+last]] / [[+total]] </span>[[+nextlink:isnot=``:then=`<span class="advsea-next"><a href="[[+nextlink]]">Next</a></span>`]]


          Then for the 10 results:
          Extract Chunk called by getExtracts
          <p class="advsea-extract">[[+extract]]</p>


          and AdvsearchResult: Chunk called by renderOutput
          <div class="advsea-result">
              <h3>[[+idx]]. <a href="[[+link:is=``:then=`[[~[[+id]]]]`:else=`[[+link]]`]]" title="[[+longtitle]]">[[+pagetitle]]</a></h3>
              <div>[[+extracts]]</div>
          </div>


          And finally AdvsearchResults : Chunk called by renderOutput
          <p class="advsea-results">[[+resultInfo]] - Server elapsed time: [[+etime]]</p>
          <div class="advsea-paging[[+pagingType]]">[[+paging]]</div>
          <div class="advsea-results-list">
              [[+results]]
          </div>
          <div class="advsea-paging[[+pagingType]]">[[+paging]]</div>
          [[+moreResults]]


          So 22 calls to advsearchutil.processChunk.


          Does the order in which you test the installs matter, ie if you test one first - and then the other, or the other way around, does that influence the results? (thinking of the server recovering from a high load situation that can slow down a second request some time after the first).
          No order effect. Whatever the order the results are still the same: the first environnement is always faster than the second.
          [ed. note: coroico last edited this post 12 years, 3 months ago.]
          • Do you have any Category permissions set on the slower instances? I can't reproduce anything like this...
              • 5811
              • 1,717 Posts
              Do you have any Category permissions set on the slower instances?
              No On the two instances the category_permission table is an empty table.

              The différence that exist between the two instances are:

              revo1 (first instance - the faster)
              - 14 categories. Mainly for snippets & plugins.
              - template of documents are set by including a html template file

              revo2 (second instance - the slower)
              - 11 categories. For chunks, snippets, Tvs and plugins.
              - template of documents are set by including several chunks (site-head, site-header, as-header, as-content, as-footer, site-footer)

              The search occurs among the same set of documents.
              The content of chunks that are preprocessed by chunk->process() function are the same on the both instances
              The search addon (advsearch 1.0.0 pl) used is the same on the both instance
              The two instance runs on the same platform (windows7, Php 5.3.0 with a limit of 128Mb of memory
              The sql requests under PhpMyAdmin provides the same performance results

              Under xdebugger profiler I saw the differences for the processing of chunks are very significative.
              So I think that the problems comes from this area.

              Is there somewhere a setting that could explain these differences ?
              How could I get a trace or a log under phpStorm to understand and follow the run and try to understand the difference.

              Thanks for your help.
              Otherwise, I will be obliged to set up from scratch an new environment and manually migrate all the resources (>150).
                • 5811
                • 1,717 Posts
                Eureka !

                Ok, on the second environment, I found that a plugin (NotParseMODxTags) that I use for the displaying of the MODx tags was incorrectly configured.
                It used the onParseDocument event ather than the onLoadWebDocument.

                So to resume - on my local platform:
                with the first instance, the search takes 0,47s
                with the second instance, with the plugin incorrectly configured the search takes 2,37s
                with the plugin disabled: 0,43s
                with the plugin correctly configured: 0,43s

                On my server
                with the first instance, the search takes 0,21s
                with the second instance, with the plugin incorrectly configured the search takes 0,57s
                with the plugin disabled: 0,15s
                with the plugin correctly configured: 0,16s

                So now, results are more coherent.

                But what I don't understand is why a plugin used with onParseDocument has an impact on the parsing of chunks during the search. (chunk->process)
                The measured performances are for the search not for the time to render a full document.
                Any explanation about this is welcome.

                Anyway take care of the events used by your plugins !!!
                • This is because OnParseDocument occurs for every tag that gets parsed in MODX Revolution. In Evolution, this only occurred after a specific pass for specific types of tags (i.e. it did not execute as often).