How to fix Slow dir on network drives.

15 views (last 30 days)
For some reason when i run the dir command on a network drive it is extremely slow compared to running it on a folder with a similar number of files/folders on a local drive. Is there a reason this is so slow or is there a workaround for the problem? I am looking to get the list of files/folders within the directory as well as whether it is a file or a directory.
I am running windows 7 with matlab r2012b
  1 Comment
MasterCK
MasterCK on 26 May 2015
Edited: MasterCK on 26 May 2015
the network is full gigabit and does not have any problem using the dos command to do a directory listing. I am testing the speed by putting it in a loop and repeating 100 times.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 26 May 2015
It matters a great deal which network filesystem you are using.
If you are using the original NFS (also known as NFSv1) then this behaviour is a consequence of NFSv1's "stateless" design that (if I recall) does not allow caching of directory entries because of the potential synchronization problems if the directory information changed while it was "out" on the network. I no longer recall whether the big improvement for this was NFSv2 or NFSv3.
If you are using Novell then there is a server setting that can help on this, but I refuse to dig that deep into my memory... that was a good decade ago.
If you are using any of the earlier MS Windows network filesystems then I seem to recall that there was a boot.ini setting to adjust the number of network directory slots, and upping it could make a big difference in performance.
I do not know much about any new MS Windows network filesystems.

More Answers (0)

Categories

Find more on File Operations in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!