We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 349
    • 76 Posts
    Hi, i´ve built a site with Revo and have a page where 160 documents get listed via the getResource snippet.
    Each document contains up to 12 template variables.
    Speed measure (with MODx info-tags) shows the following:
    QueryTime: 0.0003 s
    Queries: 3
    Total time: 17.1366 s
    17 seconds is much too long for this. Since the QueryTime
    [^qt^]
    is very fast, i think it has to be the parsing of the TVs.
    When i remove some of the TVs, the output happens faster.
    Here is my uncached snippetcall:
    [[getResources? &parents=`61`&tpl=`adresse`&includeTVs=`1`&tvPrefix=``&limit=`500`]]

    And my adresse chunk:
    <div class="addresscontainer clearfix">
    	<p>
    [[If? &subject=`[[hotelbild?&alias=`[[+alias]]`]]` &operator=`notempty` &then=`<img class="floatright" src="assets/image.php?src=[[hotelbild?&alias=`[[+alias]]`]]&w=150&h=120&ar=1" />`]]
    		<b>[[+pagetitle]]</b><br />
    		[[If? &subject=`[[+Ort]]` &operator=`notempty` &then=`[[If? &subject=`[[+PLZ]]` &operator=`notempty` &then=`[[+PLZ]] [[+Ort]]`]]`]]
    	<div class="clearfix">
                [[If? &subject=`[[+strasse]]` &operator=`notempty` &then=`<p>`]]
                [[If? &subject=`[[+Vorname]][[+Nachname]]` &operator=`notempty` &then=`[[+Vorname]] [[+Nachname]]<br />`]]
                [[If? &subject=`[[+strasse]]` &operator=`notempty` &then=`[[+strasse]]<br />`]]
                [[If? &subject=`[[+Telefon]]` &operator=`notempty` &then=`Tel.: [[+Telefon]]<br />`]]
                [[If? &subject=`[[+Mobil]]` &operator=`notempty` &then=`Tel.: [[+Mobil]]<br />`]]
                [[If? &subject=`[[+Fax]]` &operator=`notempty` &then=`Fax: [[+Fax]]`]]
                [[If? &subject=`[[+strasse]]` &operator=`notempty` &then=`</p>`]]
            </div>
             <p class="p-seperator2"></p>
            
    	[[If? &subject=`[[+email]]` &operator=`notempty` &then=`<span><a href="mailto://[[+email]]">E-Mail</a></span>`]]
            [[If? &subject=`[[+URL]]` &operator=`notequal`&operand=`http://` &then=`<span><a href="[[+URL]]" class="external">Website</a></span>` ]]
            [[If? &subject=`[[+content]]` &operator=`notequal`&operand=`` &then=`<span><a href="[[+id]]">mehr Informationen</a></span>` ]]
    </div>
    


    After reloading the page, the measurements show
    QueryTime: 0.0000 s
    Queries: 0
    Total time: 8.5016 s
    PHP parsing time: 8.5016 s
    which is also too long for this amount of data.

    Is Revo really so slow?
      • 22295
      • 153 Posts
      I’m pretty sure the problem is related with [[if snippet.
      I had the same issue, but i don’t remember how it was resolved.. I will check later and let you know if i find those templates.
      One thing I do remember is that [[If was evil in performance, and probably no because of it, but due to repeated placeholders parsing. but yet again - I’m not sure..

      For a test , remove all (or most) [[If from the tpl, but leave in the tv placeholders.
      How long it takes now?
        • 22303 MODX Staff
        • 10,725 Posts
        Hmm 160 Resources with twelve TV’s each (thought the TV’s in this are trivial cause you are not processing them); now multiple that times 13 executions of If per Resource, plus two executions of whatever [[hotelbild?&alias=`[[+alias]]`]] is. TBH, the If’s should be fairly efficient, but I have no idea what [[hotelbild?&alias=`[[+alias]]`]] does or how long it takes per Resource.

        BTW, ignore the query time atm, that is not accurate.
          • 349
          • 76 Posts
          I removed the hotelbild snippet (which looks if an image exists and returns the path to it) from my chunk and just used the following chunk now:
          <div class="addresscontainer clearfix">
          		<b>[[+pagetitle]]</b><br />
          		[[If? &subject=`[[+Ort]]` &operator=`notempty` &then=`[[+PLZ]] [[+Ort]]`]]
          </div>
          
          But still 9 seconds parsing time. Still too long for 3 placeholders.

          I did another test as suggested by oori and removed the IF´s but Total time: 7.7637 s for these 3 placeholders:(
            • 22303 MODX Staff
            • 10,725 Posts
            I just don’t see how parsing 160 Resources in a single request is ever going to be efficient. Hopefully you can cache the data.