bugranger - Bugs: bug #42096, Directory file count causes...

 
 

bug #42096: Directory file count causes excessive slowdown

Submitted by:  Yiyang Chen <yiyangc91>
Submitted on:  Fri 11 Apr 2014 01:22:37 AM UTC  
 
Severity: 3 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 11 Apr 2014 02:05:30 PM UTC, comment #1:

Good idea, thank you. I added the setting "automatically_count_files" for this in the git repository.

Roman Z. <hut>
Project Administrator
Fri 11 Apr 2014 01:22:37 AM UTC, original submission:

In container/directory.py on line 398:


def size(self):
try:
size = len(os.listdir(self.path)) # bite me
except OSError:
self.infostring = BAD_INFO

Given the following example directory structure:

  • captures
    • 2014-01-24
      • 0001.tga
      • 0002.tga
      • ...
      • 0433.tga
    • 2014-01-25
      • 0001.tga
      • ...
      • 0231.tga
    • ...
    • 2014-03-23
      • 0001.tga
      • ...

When entering the "captures" directory, ranger will attempt to retrieve the file counts for every single subdirectory. Over CIFS, NFS, etc, this takes a significant amount of time.

A workaround is to avoid listing files until they are actually opened:


def size(self):
try:
size = 0
except OSError:
self.infostring = BAD_INFO

This still allows the size of the directory to be set when it is actually opened.

It would be nice if there was a :set nofilecount property for this.

Yiyang Chen <yiyangc91>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by hut (Posted a comment)
  • -unavailable- added by yiyangc91 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 11 Apr 2014 02:05:30 PM UTChutStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1