Very slow 'adding' files

Asked by Juan Pablo González Riopedre

When you change to a directory, the program is very slow 'adding' files until it shows them. What is doing the program in this case? Why is it so slow? Is this problem caused to avoid duplicated names?
Thanks. Your program is wonderful!

Question information

Language:
English Edit question
Status:
Solved
For:
pyRenamer Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Adolfo González Blázquez (infinito) said :
#1

Well, I'm not sure what is "slow" for you, but in my system it doesn't look slow.

Anyway, what pyRenamer does is:
- Read the files inside directory using python's glob function.
- Add the files to a gtk.TreeStore
- Show the files on the GUI

Maybe, the perfomance problem comes from the gtk.TreeStore, I'm not sure...

Revision history for this message
Juan Pablo González Riopedre (riopedre) said :
#2

In my system, 'slow' is 30 seconds to read a directory with 33 files inside. Or 42 seconds with another directory with 48 files. Almost 1 second per file.
Perhaps this problem comes from the configuration of my system. I don't know.
Thanks!

Revision history for this message
Adolfo González Blázquez (infinito) said :
#3

Wow, that's really weird.

Could you please try this command to see if the problem comes from pyrenamer or from python's glob?

$ python
>>> import glob
>>> glob.glob('/etc/*')
>>> glob.glob('the_dir_you're_having_problems_with')

Revision history for this message
Adolfo González Blázquez (infinito) said :
#4

Need more information from the user to see if it's a pyRenamer problem, or other problem.

Revision history for this message
Juan Pablo González Riopedre (riopedre) said :
#5

Well. Function 'glob' is not the problem. It returns list of files almost immediately. The problem is with all the directories. There is not one directory slower than other. It depends of the number of files inside.

Revision history for this message
Adolfo González Blázquez (infinito) said :
#6

I think is better to continue this on the bug report.
https://bugs.launchpad.net/bugs/272859

Revision history for this message
Adolfo González Blázquez (infinito) said :
#7

Fix commited to svn trunk.