Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-18702

Performance improvements on Camel File component

XMLWordPrintable

      In Camel File component, the FileConsumer.pollDirectory() call several methods that are java.ioFile.* 

      java.io.File.length()
      java.io.File.lastModified()
      java.io.File.isDirectory()
      and another
      java.io.File.isDirectory()

      Probably java.io.File is inefficient. Java 7's java.nio.file package with Files.newDirectoryStream() is much more efficient and should be used these days.

      https://www.rgagnon.com/javadetails/java-get-directory-content-faster-with-many-files.html

      found a factor of 460x performance improvement on large directories with java.nio.file vs java.io.File.

      Is there a good reason why we don't use java.nio.file.* to improve performance? 

              rnetuka@redhat.com Radovan Netuka
              rhn-support-whui Roger Hui
              Federico Mariani Federico Mariani
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: