Artifacts Associated With Ticket 687906ffffffffff
Ticket change [556e3e583a] (rid 94133) by vincentdarley on 2003-02-17 11:14:36:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
tclPkgUnknown may check directories multiple times and uses 'file readable' more than is necessary. This patch fixes these problems and provides a modest performance improvement for Tcl 8.4.2. (relevant given the complaints in comp.lang.tcl about filesystem and package require performance).
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "vincentdarley"
- subsystem initialized to: "39. Package Manager"
- title initialized to: "tclPkgUnknown performance enhancement"
- type initialized to: "Patch"
Ticket change [ec913b82c4] (rid 103726) by vincentdarley on 2003-02-17 18:16:11:
- icomment:
File Added - 42652: package.diff Logged In: YES user_id=32170 attached patch (sf always fails the first time for me...)
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Add attachment "package.diff" [c6c8047205] (rid 121825) by vincentdarley on 2003-02-17 18:16:11.
Ticket change [4bd4ebcf15] (rid 126773) by dgp on 2003-02-18 12:31:46:
- icomment:
Logged In: YES user_id=80530 At first glance, this looks pretty good. I'm curious if we have any benchmarks, or can find someone to run some, which will demonstrate that this patch makes a measurable difference in those situations where tclPkgUnknown performance is a problem. I'm also curious how the 8.4.1 version and this patched version compare with the [tclPkgUnknown] that was part of Tcl 8.3.0 (Revision 1.11 of file library/package.tcl). Would be nice to rollback those complications that were arguably only added to work around bugs in tcllib's package indexing.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [757d11aa27] (rid 105396) by vincentdarley on 2003-02-18 17:31:08:
- icomment:
Logged In: YES user_id=32170 I did run some simple benchmarks on Windows (using a modified file.bench that Jeff now has). This speeded up the package startup on my machine by about 20%. The changes, as you can tell, are more to prevent nasty 'worst cases' from emerging. In particular, if you have, say, [info library] in your auto_path multiple times, I imagine this patch could provide a very large improvement (but I haven't tested that carefully).
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [64cf0be347] (rid 92837) by dgp on 2003-02-20 08:01:22:
- assignee changed to: "vincentdarley"
- icomment:
File Added - 42930: 687906.patch Logged In: YES user_id=80530 Here's a new patch that tries to avoid extending $use_path with multiple copies of the same directory, and tries to avoid generating the string rep of the $old_path and $auto_path variables. Can you check it for correctness, and see if it improves performance any more? Still curious if the right answer isn't to chuck all the complexity and revert to the [tclPkgUnknown] of 8.3.0. Well-behaved index scripts shouldn't be messing with auto_path anyway.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
Ticket change [a2447ec509] (rid 109860) by hobbs on 2003-02-20 08:15:37:
- icomment:
Logged In: YES user_id=72656 tcllib messed with auto_path. It is not good to throw away correctness for speed, so we should continue to just look forward on this one.
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [115499020c] (rid 95116) by dgp on 2003-02-20 13:35:36:
- icomment:
Logged In: YES user_id=80530 I'll agree to disagree on whether the current behavior of [tclPkgUnknown] represents "correctness". :) Correct or not, it's been that way long enough, and there's enough stuff deployed depending on it, I agree we can't change it now, and need to "look forward" instead. Both Vince's and my patch preserve current functioning. They just reorder the logic a bit to reduce the number of [file] calls (which might be expensive on some VFS's). I'm OK with accepting either one for 8.4.2, if that meets Jeff's standards for "code slush". Preference, Vince? More performance improvement will have to come from a caching scheme, or from alternative [package unknown] callbacks. Will file those as other reports.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [ea63c03e76] (rid 103374) by vincentdarley on 2003-02-20 15:53:42:
- assignee changed to: "dgp"
- icomment:
Logged In: YES user_id=32170 I prefer dgp's patch (never liked that if {$listone == $listtwo} stuff), which also seems to work, so please do check in! Vince. - login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
Ticket change [6c2226f442] (rid 128450) by dgp on 2003-02-21 05:07:39:
- assignee changed to: "jenglish"
- icomment:
Logged In: YES user_id=80530 please give this a careful check for inclusion in 8.4.2.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
Ticket change [f6ea792076] (rid 130397) by jenglish on 2003-02-21 08:51:00:
- assignee changed to: "dgp"
- icomment:
Logged In: YES user_id=68433 Looks good. As discussed on the chat, you can save some stat() calls by omitting both calls to [file readable $file], since unreadable pkgIndex.tcl files are handled by the subsequent "[catch {source $file} ...]", at the cost of a minor change in semantics (unreadable pkgIndex files would log error messages, which they do not at present.) The test for list equality (~line 516) could use a comment; it's not immediately obvious from the code what's going on. Another way of testing for list equality just occurred to me: # Check if $auto_path has changed: set equal [expr {[llength $old_path] == [llength $auto_path]}] if {$equal} { foreach e1 $old_path e2 $auto_path { if {[string compare $e1 $e2]} { set equal 0 break } } } Anyway, back to DGP. This looks comittable. - login: "jenglish"
- mimetype: "text/plain"
- username: "jenglish"
Ticket change [ecd63b91db] (rid 103776) by hobbs on 2003-02-21 08:54:48:
- icomment:
Logged In: YES user_id=72656 Do not use string compare for ==/!= testing - it's need to return -1/0/1 makes it more costly. Use ne ... this is 8.4 after all.
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [6956128649] (rid 103231) by dgp on 2003-02-21 11:49:48:
- icomment:
Logged In: YES user_id=80530 As noted in the chat, dropping the [file readable] tests would re-open Tcl Bug 217824. It's conceivable that the improved performance is worth ungraceful reaction to file permission problems that should not happen, but I'll save that judgment for 8.5a. I really think the big performance improvements will have to come from other approaches already mentioned. Will add comments and consider alternative list equality algorithms (with ne or eq, natch) and commit soon.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [db75308afd] (rid 107965) by dgp on 2003-02-21 12:35:09:
- icomment:
File Deleted - 42930: File Added - 43073: 687906.patch Logged In: YES user_id=80530 Here's the updated patch. Committing it now, please continue to review and test. Leaving this report open as a reminder that similar enhancments can also be applied to the Mac-specific package unknown procs.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "687906.patch" [d180f2fea3] (rid 113361) by dgp on 2003-02-21 12:35:09.
Ticket change [c8988d74b7] (rid 122131) by dgp on 2003-02-21 12:41:04:
- assignee changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=80530 Vince, are you willing to look over the committed changes, and apply similar enhancements to [tcl::MacOSXPkgUnknown] and [tcl::MacPkgUnknown] ? Thanks!
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
Ticket change [b27e2edc2e] (rid 98344) by vincentdarley on 2003-02-21 15:38:20:
- icomment:
Logged In: YES user_id=32170 I'll take a look at the mac side of things. Regarding removing 'file readable', I don't think there's any need. As long as at least 1 file/source/open operation is going to take place on a Tcl_Obj, adding others won't impact performance much at all (in fact we should be better than 8.3 at least in terms of the increment in time). What this patch manages is to avoid *any* file call under certain circumstances. That saves a whole bunch of normalization and utf-native conversion. I may not be able to get to the Mac side before 8.5a, but I'll try.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [cc280025e5] (rid 95642) by vincentdarley on 2003-09-25 01:06:11:
- closedate changed to: "2003-09-24T18:06:11"
- closer changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=32170 Ok, applying the equivalent to the MacOS and MacOSX procedures.
- login: "vincentdarley"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "vincentdarley"