Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b3bbc2ee9bd254f66cfa0e9a8d838f0cef3b531f
Ticket: 219120ffffffffffffffffffffffffffffffffff
Performance of glob command
User & Date: nobody on 2000-10-26 01:11:04
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 6216 Bug
    Version: 8.3.1
    SubmitDate: '2000-09-05'
    LastModified: '2000-10-20'
    Severity: SER
    Status: Released
    Submitter: techsupp
    ChangedBy: hobbs
    OS: Windows 95
    OSVersion: win95sr2
    FixedDate: '2000-10-20'
    FixedInVersion: 8.4a2
    ClosedDate: '2000-10-25'
    
    
    Name:
    Martin Mergel
    
    ReproducibleScript:
    On a directory with 4000 files, a simple glob * takes about 2:45 minutes with Tcl 8.3.1
    
    DesiredBehavior:
    With Tcl 8.0.2, the same command is executed within 6 seconds
    
    
    
    The file was stat'ed more than necessary.  This has been corrected
    
    for 8.4a2 with the following patch:
    
    
    
    Index: win/tclWinFile.c
    
    ===================================================================
    
    RCS file: /home/cvs/external/tcl/win/tclWinFile.c,v
    
    retrieving revision 1.7
    
    diff -r1.7 tclWinFile.c
    
    329,330c329,336
    
    <       attr = (*tclWinProcs->getFileAttributesProc)(nativeName);
    
    <       Tcl_DStringFree(&ds);
    
    ---
    
    > 
    
    >       /*
    
    >        * 'attr' represents the attributes of the file, but we only
    
    >        * want to retrieve this info if it is absolutely necessary
    
    >        * because it is an expensive call.
    
    >        */
    
    > 
    
    >       attr = NULL;
    
    335a342
    
    >                   attr = (*tclWinProcs->getFileAttributesProc)(nativeName);
    
    392,396c399,406
    
    <       } else if (attr & FILE_ATTRIBUTE_DIRECTORY) {
    
    <           Tcl_DStringAppend(dirPtr, "/", 1);
    
    <           result = TclDoGlob(interp, separators, dirPtr, tail, types);
    
    <           if (result != TCL_OK) {
    
    <               break;
    
    ---
    
    >       } else {
    
    >           attr = (*tclWinProcs->getFileAttributesProc)(nativeName);
    
    >           if (attr & FILE_ATTRIBUTE_DIRECTORY) {
    
    >               Tcl_DStringAppend(dirPtr, "/", 1);
    
    >               result = TclDoGlob(interp, separators, dirPtr, tail, types);
    
    >               if (result != TCL_OK) {
    
    >                   break;
    
    >               }
    
    398a409,414
    
    >       /*
    
    >        * Free ds here to ensure that nativeName is valid above.
    
    >        */
    
    > 
    
    >       Tcl_DStringFree(&ds);
    
    > 
    
     
    
    -- 10/20/2000 hobbs
    
  4. foundin changed to: "obsolete: 8.3.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "Performance of glob command"
  11. type changed to: "Bug"