Uploaded image for project: 'Maven Doxia'
  1. Maven Doxia
  2. DOXIA-487

Speed up XdocParserTest.setup

    XMLWordPrintableJSON

Details

    • Test
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3
    • 1.4
    • Module - Xdoc
    • None

    Description

      I noticed that the XdocParserTest is very slow.
      The first possible cause I could think of was the setup, which contains this code:

      // AbstractXmlParser.CachedFileEntityResolver downloads DTD/XSD files in ${java.io.tmpdir}
              // Be sure to delete them
              String tmpDir = System.getProperty( "java.io.tmpdir" );
              String excludes = "xdoc-*.xsd, xml.xsd";
              List<String> tmpFiles = FileUtils.getFileNames( new File( tmpDir ), excludes, null, true );
              for ( Iterator<String> it = tmpFiles.iterator(); it.hasNext(); )
              {
                  File tmpFile = new File( it.next().toString() );
                  tmpFile.delete();
              }
      

      These are my benchmark numbers in ms for this piece of code when running 1 test (so these is the time spent per test method for setup only):

      setup: 61866
      setup: 9530
      setup: 9130
      setup: 9255
      setup: 9770
      setup: 9300
      setup: 9391
      setup: 9352
      setup: 9170
      setup: 9167
      setup: 9088
      setup: 9214
      setup: 9508
      setup: 9161
      setup: 9426
      setup: 10308
      setup: 9952
      setup: 10491
      

      That's about 3 minutes of delay for removing a few files from the temp-directory.

      Attachments

        Activity

          People

            rfscholte Robert Scholte
            rfscholte Robert Scholte
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: