Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6241

don't filter subdirectories in listAll()

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.1, 6.0
    • None
    • None
    • New

    Description

      The issue is, today this means listAll() is always slow, sometimes MUCH slower, because it must do the fstat()-equivalent of each file to check if its a directory to filter it out.

      When i benchmarked this on a fast filesystem, doing all these filesystem metadata calls only makes listAll() 2.6x slower, but on a non-ssd, slower i/o, it can be more than 60x slower.

      Lucene doesn't make subdirectories, so hiding these for abuse cases just makes real use cases slower.

      To add insult to injury, most code (e.g. all of lucene except for where RAMDir copies from an FSDir) does not actually care if extraneous files are directories or not.

      Finally it sucks the name is listAll() when it is doing anything but that.

      I really hate to add a method here to deal with this abusive stuff, but I'd rather add isDirectory(String) for the rare code that wants to filter out, than just let stuff always be slow.

      Attachments

        1. LUCENE-6241-alternative.patch
          16 kB
          Robert Muir
        2. LUCENE-6241.patch
          9 kB
          Robert Muir
        3. LUCENE-6241.patch
          9 kB
          Robert Muir

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rcmuir Robert Muir
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: