Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-4281

Rendering links takes about 8 times as long in syntax 2.0 as 1.0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.0 RC2, 2.1 M1
    • 2.0 M4
    • {Unused} Rendering 2.0
    • None
    • Linux2.6 Jetty6.1.3 XWiki trunk 23274 Postgres8.4.0
    • Unknown

    Description

      To repeat:
      add this line to the beginning of view.vm

      #set($startTime = $datetool.getSystemTime())
      

      and this line to the end

      $mathtool.sub($datetool.getSystemTime(), $startTime)
      

      create a document and in it put this:

      {{groovy}}
      StringBuffer index1 = new StringBuffer();
      StringBuffer index2 = new StringBuffer();
      for(int i=0; i<1000; i++){
          String id = java.util.UUID.randomUUID().toString().substring(0,8);
          index1.append("[").append(id).append("]");
          index2.append("[[").append(id).append("]]");
          document = xwiki.getDocument("Test",id);
          document.save();
      }
      document = xwiki.getDocument("Test","index1");
      document.doc.setContent(index1.toString());
      document.doc.setSyntaxId("xwiki/1.0");
      document.save();
      document = xwiki.getDocument("Test","index2");
      document.doc.setContent(index2.toString());
      document.doc.setSyntaxId("xwiki/2.0");
      document.save();
      {{/groovy}}
      

      go to pages index1 and index2 and observe the differences in the numbers at the bottom of the page.
      I measured 1255 miliseconds for 1.0 and 8825 milliseconds for 2.0

      I think what is happening is DocumentAccessBridge is not consulting the XWikiCacheStore while rendering engine 1.0 is. When my database is set to log all queries, the syntax2.0 version queries each link even if it has been rendered only a short time before. I find it mysterious that DocumentAccessBridge and rendering engine 1.0 both call an XWiki.getDocument function, perhaps there is something wrong with the DocumentAccessBridge context?

      Attachments

        1. XWIKI-4281-usePageExistCache.patch
          2 kB
          CalebJamesDeLisle
        2. XWIKI-4281-usePageExistCache2.patch
          1.0 kB
          CalebJamesDeLisle

        Activity

          People

            tmortagne Thomas Mortagne
            calebjamesdelisle CalebJamesDeLisle
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: