Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2003-02-12
01:56 • Closed ticket [682500ffff]: speed up filesystem patch plus 7 other changes artifact: da8f74e33c user: hobbs
00:28 • Ticket [682500ffff]: 4 changes artifact: 7b98c67f3e user: vincentdarley
2003-02-11
09:27 • Ticket [682500ffff]: 4 changes artifact: 690e0a52c8 user: hobbs
09:27 • Add attachment fs4-682500.diff to ticket [682500ffff] artifact: 23674d50b0 user: hobbs
09:25 • Ticket [682500ffff] speed up filesystem patch status still Open with 4 other... artifact: a62c2c0fed user: hobbs
09:25 • Add attachment fs3.1-682500.diff to ticket [682500ffffffffff|682500ffff... artifact: 0ad9ed429a user: hobbs
09:24 • Ticket [682500ffff] speed up filesystem patch status still Open with 5 other... artifact: 75c83d8741 user: hobbs
09:08 • Add attachment fs3-682500.diff to ticket [682500ffff] artifact: 077ee99226 user: hobbs
09:08 • Ticket [682500ffff] speed up filesystem patch status still Open with 4 other... artifact: f36bce636a user: hobbs
04:31 • Open ticket [682500ffff]. artifact: f559d3d696 user: hobbs
2003-02-10
19:58 • Closed ticket [682500ffff]. artifact: 639ff46d29 user: vincentdarley
10:48 • Ticket [682500ffff]: 4 changes artifact: cb87241d67 user: hobbs
10:48 • Add attachment fs2-682500.diff to ticket [682500ffff] artifact: d837e3b7bd user: hobbs
06:37 • Ticket [682500ffff] speed up filesystem patch status still Open with 4 other... artifact: 5921f162d9 user: vincentdarley
06:36 • Add attachment fsspeed2.patch to ticket [682500ffff] artifact: 7409e22f15 user: vincentdarley
06:36 • Ticket [682500ffff] speed up filesystem patch status still Open with 4 other... artifact: 23dc624cf6 user: vincentdarley
2003-02-09
11:49 • Ticket [682500ffff]: 4 changes artifact: 7054e24ec1 user: hobbs
11:49 • Add attachment fs-682500.diff to ticket [682500ffff] artifact: bf8d756edc user: hobbs
11:49 • Ticket [682500ffff] speed up filesystem patch status still Open with 4 other... artifact: ae22eced54 user: hobbs
10:00 • Ticket [682500ffff]: 4 changes artifact: 7320b6934d user: hobbs
2003-02-08
05:01 • Ticket [682500ffff]: 4 changes artifact: ddd0e623f6 user: jcw
02:06 • Ticket [682500ffff]: 4 changes artifact: b015fc653f user: vincentdarley
02:06 • Ticket [682500ffff]: 4 changes artifact: be82a9b3ef user: vincentdarley
02:06 • Add attachment testfs.tcl to ticket [682500ffff] artifact: 5a27ea2a13 user: vincentdarley
02:05 • Add attachment fsspeed.diff to ticket [682500ffff] artifact: 4244a26619 user: vincentdarley
02:05 • Ticket [682500ffff] speed up filesystem patch status still Open with 4 other... artifact: 6a72d7bd4d user: vincentdarley
2003-02-07
19:02 • New ticket [682500ffff]. artifact: 25cbf6741c user: vincentdarley

speed up filesystem patch

Closed / Accepted682500ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2003-02-07 19:02:00
Here's a first cut at a patch which should speed up 
the filesystem in Tcl 8.4.1.  At least on Windows, 
with this patch Tcl 8.4 is faster in things like:

foreach f [glob -dir $dir *] {
   file stat $f arr
   ...
}

than 8.3, often by a quite a large margin.

I have also attached a file testfs.tcl which I am 
using for benchmarking.

It is untested on Unix.
vincentdarleyplain2003-02-08 02:05:29
File Added - 41785: fsspeed.diff
vincentdarleyplain2003-02-08 02:06:16
Logged In: YES 
user_id=32170

Added test script
vincentdarleyplain2003-02-08 02:06:17
File Added - 41786: testfs.tcl
jcwplain2003-02-08 05:01:25
Logged In: YES 
user_id=1983

confirmed to work (quick test) on Win32 and Linux
- binary tclkits based on these now in http://www.equi4.com/pub/tk/newer/
hobbsplain2003-02-09 10:00:29
Logged In: YES 
user_id=72656

Note that this part of the patch looks highly suspicious to me, 
although the return does seem key to Win not going boom:

@@ -3766,10 +3761,14 @@
     if (objPtr->typePtr == &tclFsPathType) {
 FsPath *fsPathPtr = (FsPath*) objPtr-
>internalRep.otherValuePtr;
 if (fsPathPtr->filesystemEpoch != 
theFilesystemEpoch) {
+    if (objPtr->bytes == NULL) {
+
+    }
     FreeFsPathInternalRep(objPtr);
     objPtr->typePtr = NULL;
     return Tcl_ConvertToType(interp, objPtr, 
&tclFsPathType);
 }
+return TCL_OK;
 if (fsPathPtr->cwdPtr == NULL) {
     return TCL_OK;
 } else {

That's in tclIOUtil.c.  Also, this patch blows the unix test 
suite (no crashes, just lots of errors), so something about it 
isn't correct.  I've isolated it to the tclUnixFile.c change.  That 
looks OK, but I had to revert to the old version for 
correctness.  Note that one simple change erases all 
speedups on Linux.
hobbsplain2003-02-09 11:49:27
Logged In: YES 
user_id=72656

This patch appears incorrect.  I've attached something that 
may be more correct, but there may be more fundamental 
flaws in the changes.
hobbsplain2003-02-09 11:49:30
File Added - 41889: fs-682500.diff
vincentdarleyplain2003-02-10 06:36:24
File Added - 41948: fsspeed2.patch
vincentdarleyplain2003-02-10 06:37:46
Logged In: YES 
user_id=32170

Attached newer patch.  Should work on Linux, Windows 
at least.
hobbsplain2003-02-10 10:48:58
File Added - 41965: fs2-682500.diff

Logged In: YES 
user_id=72656

Attached updated patch.
vincentdarleyplain2003-02-10 19:58:52
Logged In: YES 
user_id=32170

This patch has been applied.  Further improvements are 
definitely still possible, but require a bit more analysis 
first.
hobbsplain2003-02-11 04:31:07
Logged In: YES 
user_id=72656

The current patch is incorrect.  This needs further testing.
hobbsplain2003-02-11 09:08:58
File Added - 42051: fs3-682500.diff

Logged In: YES 
user_id=72656

Attached is the patch with extra failing test.
hobbsplain2003-02-11 09:24:11
File Added - 42054: fs3.1-682500.diff

Logged In: YES 
user_id=72656

And attached is a patch to fs3-682500.diff that corrects the 
failing test.  However, the entire handling of cwdLen, adding 
and subtracting 1 seems incorrect.  For example, 
Tcl_FSGetNormalizedPath then passes cwdLen-1, which 
may also not be correct.  The entire handling of the case for 
cwdLen == 0 may be incorrect in other places.  It is likely 
most prudent to revert this all until a more thorough review 
with additional tests is made.
hobbsplain2003-02-11 09:25:28
File Deleted - 42054: 



File Added - 42055: fs3.1-682500.diff

Logged In: YES 
user_id=72656

Attaching same patch with correct -u formatting this time.
hobbsplain2003-02-11 09:27:09
File Added - 42057: fs4-682500.diff

Logged In: YES 
user_id=72656

And one more time in full (fs4) to make it easy for others ...
vincentdarleyplain2003-02-12 00:28:12
Logged In: YES 
user_id=32170

NB. Jeff has now committed a fixed patch.  We shall see 
if any new bugs turn up over the coming week or two.
hobbsplain2003-02-12 01:56:25
Logged In: YES 
user_id=72656

Let's call this closed and have any bugs introduced be 
reported separately.
Log in (anonymous is fine) to add a comment.

Attachments: