Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2f2bcf4c32180902d4cd6eaca6f152df69ddac33
Ticket: 605074ede5ccc8bc3fdd67e339575c45bd1a1522
New sub-command: file utime
User & Date: damkerngt on 2013-10-18 14:06:07
Changes

  1. icomment:
    I believe I can pinpoint the pattern that could cause this stat() problem now.
    
    The <strong>pre-condition</strong>, which is very important is:
    We need to set <code>[file mtime]</code> on a massive number of files that distributed among several sub-directories.
    The number of files is important. For example, 10,000 files might not cause any penalty, 50,000 files does.
    Directory structure must be realistic. Updating mtime of 50,000 files in a single directory might not cause the penalty, but 50,000 files in 5,000 directories does. (Hence, the benchmark script tries to imitate such a structure.)
    
    
    <strong>Additional conditions:</strong>
    The penalty can occur on both Linux and Windows (I have no Mac OS X to test at the moment).
    
    On Linux (I tested it on Ubuntu), if there was massive disk writes just before or during the moment we set <code>[file mtime]</code>, the penalty will occur. (A task that could be done in less than 3 seconds went up to 47 seconds.) If not, calling or not calling GetStatBuf() does not matter.
    
    On Windows, the penalty seems to depend on both whether we just have massive disk writes and the remaining available memory. The remaining available memory seems to have more impact. The strange thing is that you don't need to have really low memory in order to observe the huge penalty, just have it used up about 2/3 (i.e. 1/3 of your memory left) would do. (A task that could be done in 25 seconds went up to 125 seconds.)
    
    Please find the benchmark code in [http://paste.tclers.tk/2926].
    
  2. login: "damkerngt"
  3. mimetype: "text/x-fossil-wiki"